WinToolbar Object
Description
A Stingray ToolBar control.
Operations
The sections below list the built-in methods and properties that you can use as operations for the WinToolbar object.
Note: You can also view a list and descriptions of the WinToolbar description properties, for use in object repository descriptions, programmatic descriptions, checkpoint and output value steps, and as argument values for the GetTOProperty and GetROProperty methods.
Methods
CaptureBitmap | Saves a screen capture of the object as a .png or .bmp image using the specified file name. |
CheckProperty | Checks whether the actual value of the specified object property matches the specified expected value within the specified timeout. |
ChildObjects | Returns the collection of child objects contained within the object. |
GetAllROProperties | Returns the collection of properties and current values from the object in the application. |
GetContent | Returns all of the nodes in the toolbar. |
GetItem | Gets name of the button based on the index. |
GetItemsCount | Gets the number of buttons in the toolbar. |
GetROProperty | Returns the current value of the description property from the object in the application. |
GetTOProperties | Returns the collection of properties and values used to identify the object. |
GetTOProperty | Returns the value of the specified description property from the test object description. |
Highlight | Highlights the object in the application. |
Press | Presses a button. |
RefreshObject | Instructs OpenText Functional Testing to re-identify the object in the application the next time a step refers to this object. |
SetTOProperty | Sets the value of the specified description property in the test object description. |
ToString | Returns a string that represents the test object. |
WaitProperty | Waits until the specified object property achieves the specified value or exceeds the specified timeout before continuing to the next step. |
Properties
Exist | Checks whether the object currently exists in the open application. |
GetContent Method
Description
Returns all of the nodes in the toolbar.
Syntax
object.GetContent
Return Type
A String value.
The returned string contains all of the items in the toolbar separated by VBScript line feed characters.
Example
'The following example uses the GetContent method to return the names 'of all the buttons in the Formatting toolbar of the RowList Sample 'window and write them to the run results. Reporter.ReportEvent micDone, "Toolbar content", Window("RowList Sample").WinToolBar("Formatting Toolbar").GetContent()
GetItem Method
Description
Gets name of the button based on the index.
Syntax
object.GetItem (ButtonIndex)
Arguments
Parameter | Description |
---|---|
ButtonIndex |
Required. A Variant. Numeric index of the button. Index values begin with 0. |
Return Type
A String value.
Example
'The following example uses the GetItem method to retrieve the 'name of each button according to its index. If a toolbar button 'does not have a name, this method returns its index. cItems = Window("RowList Sample").WinToolBar("Formatting Toolbar").GetItemsCount sReport = "Toolbar buttons count " & cItems & vbCr For iItem = 1 To cItems sName = Window("RowList Sample").WinToolBar("Formatting Toolbar").GetItem(iItem) sReport = sReport & "Name" & sName & vbTab Next Reporter.ReportEvent micDone, "Toolbar data", sReport
GetItemsCount Method
Description
Gets the number of buttons in the toolbar.
Syntax
object.GetItemsCount
Return Type
A long integer value.
Example
'The following example uses the GetItemsCount method to return the 'number of buttons in the Formatting toolbar and write it to the 'run results. cItems = Window("RowList Sample").WinToolBar("Formatting Toolbar").GetItemsCount sReport = "Toolbar buttons count" & cItems & vbCr Reporter.ReportEvent micDone, "Toolbar data", sReport
Press Method
Description
Presses a button.
Syntax
object.Press BUTTON
Arguments
Parameter | Description |
---|---|
BUTTON |
Required. A Variant. The toolbar button to press. The button name (with quotes) or numeric index (without quotes) can denote the button. The name reflects the button's attached text (tooltip). The index of the first button in the toolbar is 0. |
Return Type
None
Example
'The following example uses the Press method to press the Bold toolbar 'button on the Formatting toolbar. Window("WordPad").WinToolBar("Formatting").Press "Bold"
See also: