Test Container exposes its functionality to script programmers through a single object, called TCForm, in the script’s global namespace. TCForm implements the following properties and methods:
· PrimarySelection
· InsertControl
· FindControl
· Log
This property is the Automation interface of the primary selected control on the form. If exactly one control is selected, it is the primary selection. If two or more controls are selected, or if no controls are selected, the primary selection is Nothing. Setting this property selects the specified control and deselects all others. Setting this property to Nothing deselects all controls.
This method inserts a new control into the form. The syntax is TCForm.InsertControl ProgID, Name.
ProgID
is a string representing the ProgID of the control to insert.
Name
is a string representing the value of the Name property for the new control. Test Container will expose the control to the script as a global variable with this name.
The InsertControl method returns the Automation interface of the new control.
The FindControl method gets the Automation interface of the control with the given name. The syntax is TCForm.FindControl Name.
Name
is the name of the control for which to retrieve the Automation interface.
The FindControl method returns the Automation interface of the control with the given name.
The Log method writes a text message to the Test Container log. By default, all log output goes to the output window, but it can also be redirected to the debugger or to a file using the Logging menu option in the Options menu. The syntax is TCForm.Log message.
message
is the message to be sent to the log.