SAPGuiComboBox Object
Description
A combo box in an SAP GUI for Windows application.
Operations
The sections below list the built-in methods and properties that you can use as operations for the SAPGuiComboBox object.
Note: You can also view a list and descriptions of the SAPGuiComboBox 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. |
Check | Checks whether the actual value of an item matches the expected value. |
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. |
GetItem | Returns the value of the item specified by the index. |
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. |
Output | Retrieves the current value of an item and stores it in a specified location. |
RefreshObject | Instructs OpenText Functional Testing to re-identify the object in the application the next time a step refers to this object. |
Select | Selects an item from the combo box list. |
SelectKey | Selects the SAP (shortcut) key representing an item in the combo box list. |
SetFocus | Sets the focus on a combo box object in an SAP GUI for Windows application. |
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. |
Object | Accesses the native methods and properties of the object. |
GetItem Method
Description
Returns the value of the item specified by the index.
Syntax
object.GetItem (Index)
Arguments
Parameter | Description |
---|---|
Index |
Required. A long integer value. Numeric index of the item. Index values begin with 1. |
Return Type
A Variant.
IMPORTANT
This method is not recorded. To add this method to your test, use the Step Generator or enter it manually in the Keyword View or Editor. For more information, see the OpenText Functional Testing User Guide.
Example
'The following example uses the GetItem method to check that when the "Food and Related Products" option is 'selected in the "Industry sector" combo box, that the tenth item ("Finished product") is displayed 'in the "Material type" combo box. Dim relatedItem SAPGuiSession("Session").SAPGuiWindow("Create Material").SAPGuiComboBox("Industry sector").Select "Food and Related Products" SAPGuiSession("Session").SAPGuiWindow("Create Material").SAPGuiComboBox("Industry sector").SetFocus relatedItem = SAPGuiSession("Session").SAPGuiWindow("Create Material").SAPGuiComboBox("Material type").GetItem(10) If relatedItem = "Finished product" Then MsgBox "The Material type comboBox has the correct value in it" SAPGuiSession("Session").SAPGuiWindow("Create Material").SAPGuiButton("Enter").Click End If
Select Method
Description
Selects an item from the combo box list.
Syntax
object.Select (Value)
Arguments
Parameter | Description |
---|---|
Value |
Required. A String value. The item to select from the list. The item can be the name or the index (in the format "#index"). Index values begin with 1. |
Return Type
None.
Example
'The following example uses the Select method to select the "Food and Related Products" option from the '"Industry sector" combo box and the fourth option from the "Material type" combo box. Then it clicks the '"Select view(s)" button. SAPGuiSession("Session").SAPGuiWindow("Create Material").SAPGuiComboBox("Industry sector").Select "Food and Related Products" SAPGuiSession("Session").SAPGuiWindow("Create Material").SAPGuiComboBox("Material type").Select "#4" SAPGuiSession("Session").SAPGuiWindow("Create Material").SAPGuiComboBox("Material type").SetFocus SAPGuiSession("Session").SAPGuiWindow("Create Material").SAPGuiButton("Select view(s)").Click
SelectKey Method
Description
Selects the SAP (shortcut) key representing an item in the combo box list.
Syntax
object.SelectKey (Key)
Arguments
Parameter | Description |
---|---|
Key |
Required. A String value. The SAP (shortcut) key representing the item to select. Tip: You can find the value of an item key by using the Object Spy to view the selected Key property. For more information, see the OpenText Functional Testing User Guide. |
Return Type
None.
IMPORTANT
This method is not recorded. To add this method to your test, use the Step Generator or enter it manually in the Keyword View or Editor. For more information, see the OpenText Functional Testing User Guide.
Example
'The following example uses the SelectKey method to select the "AG" key from the "Country" box. SAPGuiSession("Session").SAPGuiWindow("EnjoySAP Demo").SAPGuiTree("TableTreeControl").ActivateItem "Workbench Demos;USER INTERFACE;Examples of User Interface Design", "REPTITLE" SAPGuiSession("Session").SAPGuiWindow("User Interface").SAPGuiMenuBar("mbar").Select "Elements;Dropdown list box" SAPGuiSession("Session").SAPGuiWindow("User Interface").SAPGuiComboBox("Country").SelectKey "AG" SAPGuiSession("Session").SAPGuiWindow("User Interface").SAPGuiComboBox("Language").SetFocus SAPGuiSession("Session").SAPGuiWindow("User Interface").SAPGuiButton("Next screen").Click
SetFocus Method
Description
Sets the focus on a combo box object in an SAP GUI for Windows application.
Syntax
object.SetFocus
Return Type
None.
IMPORTANT
This method is recorded on the object that has the focus when information is sent to the SAP server during a recording session. This ensures that the focus is on the correct object during the test run.
Example
'The following example uses the SetFocus method to ensure that the "MEPOTEXT-EDITOR" combo box is in focus before 'the "Select" operation is performed. SAPGuiSession("Session").SAPGuiWindow("Create Purchase").SAPGuiTextArea("TextAreaControl").Set "This is an editor." SAPGuiSession("Session").SAPGuiWindow("Create Purchase").SAPGuiComboBox("MEPOTEXT-EDITOR").SetFocus SAPGuiSession("Session").SAPGuiWindow("Create Purchase").SAPGuiComboBox("MEPOTEXT-EDITOR").Select "Line editor"
See also: