VirtualTable Object
Description
An object mapped to the virtual table class.
Methods
ActivateCell | Activates the specified cell in the table. |
Exist | Checks that an object exists. |
GetTOProperty | Returns the value of the specified description property from the test object description. |
SetTOProperty | Sets the specified value of an description properties for an object. |
SelectCell | Selects the specified cell in the table. |
ToString | Returns a string that represents the current test object. |
ActivateCell Method
Description
Activates the specified cell in the table.
Syntax
VirtualTable.ActivateCell Row,Col
Argument | Type | Description |
---|---|---|
Row | Variant | Indicates the row number or the row header label. |
Col | Variant | Indicates the column number or the column header label. |
The following example activates the cell in row 2, column 2 of the Flights table:
Browser("Demo of Vo Object").Page("Demo of Vo Object").ActiveX("VoDemoForm").VirtualTable("Flights").ActivateCell 2, 2
Exist Property
Description
Checks that an object exists.
Syntax
VirtualTable.Exist([Timeout])
Argument | Type | Description |
---|---|---|
Timeout | Number | Optional. The length of time to search for the object before returning a True or False value.
For more details on the Object Synchronization Timeout, see the UFT One User Guide. |
Return Value
Boolean
The following example uses the Exist property to determine the existence of the Flights table. If the object exists a message box opens confirming its appearance.
If Browser("Demo of Vo Object").Page("Demo of Vo Object").ActiveX("VoDemoForm").VirtualTable("Flights").Exist Then
msgbox("The object exists.")
End If
GetTOProperty Method
Description
Returns the value of the specified description property from the test object description. The value is taken from the Object Repository.
Note: You can use the GetTOProperty method to retrieve the values of only those properties that are included in the test object description. Specifying a property that is not included in the test object's description results in a warning status for the step and the test. For more details on adding properties to a test object description, see the UFT One User Guide.
Syntax
VirtualTable.GetTOProperty(Property)
Argument | Type | Description |
---|---|---|
Property | String | The description properties whose value is retrieved from the object description. |
Return Value
Variant
The following example uses the GetTOProperty method to retrieve the Size property of the Flights table.
Dim ObjectSize
ObjectSize = Browser("Demo of Vo Object").Page("Demo of Vo Object").ActiveX("VoDemoForm").VirtualTable("Flights").GetTOProperty("Size")
SetTOProperty Method
Description
Sets the specified value of an description properties for an object.
Note: SetTOProperty changes the properties used to identify an object during run-time. It has no effect on the Active Screen or the values saved in the Object Repository for the object.
Syntax
VirtualTable.SetTOProperty Property, Value
Argument | Type | Description |
---|---|---|
Property | String | The description properties to set. |
Value | Variant | The value to assign to the listed property. |
The following example uses the SetTOProperty method to set the value of the Flights table test object's Size property during the test run.
Browser("Demo of Vo Object").Page("Demo of Vo Object").ActiveX("VoDemoForm").VirtualTable("Flights").SetTOProperty "Size",0
SelectCell Method
Description
Selects the specified cell in the table.
Syntax
VirtualTable.SelectCell Row,Col
Argument | Type | Description |
---|---|---|
Row | Variant | Indicates the row number or the row header label. |
Col | Variant | Indicates the column number or the column header label. |
The following example selects the cell in row 2, column 2 of the Flights table:
Browser("Demo of Vo Object").Page("Demo of Vo Object").ActiveX("VoDemoForm").VirtualTable("Flights").SelectCell 2, 2
ToString Method
Description
Returns a string that represents the current test object.
Tip: The ToString method is useful if you want to retrieve the test object name and type from within a function or keyword.
Syntax
VirtualTable.ToString
Return Value
A String value. The name of the test object and its generic type, for example, MyTable VirtualTable
.
The following example uses the ToString method to generate a report detailing the dimensions of a VirtualTable test object.
Sub ReportRectangle(obj)
x = obj.GetTOProperty("x")
y = obj.GetTOProperty("y")
w = obj.GetTOProperty("width")
h = obj.GetTOProperty("height")
Reporter.ReportEvent micDone, obj.ToString() & " dimensions", "The Virtual object " & obj.ToString() & " is defined using the following dimensions: " & x & ", " & y & ", " & x+w & ", " & y+h
End Sub
'Sample usage
ReportRectangle Window("Form3").VirtualTable("VirtualTable1")