[Windows] Select Option By Label
Descriptionβ
Select a visible option in a combo box by its label.
Keyword name: selectOptionByLabel
Parametersβ
| Parameter | Parameter Type | Required | Description |
|---|---|---|---|
windowsObject | WindowsTestObject | Yes | An object that describes the locator and locator strategy to find Windows Element. |
label | String | Yes | The label of the item you want to select in the combo box |
timeout | int | Yes | The system wait for this much time (seconds) to execute the keyword and return result |
flowControl | FailureHandling | Optional | Specify failure handling schema to determine whether the execution should be allowed to continue or stop. |
Exampleβ
This script selects an option labeled βItem 1β in a Windows application's combo box. It first locates the combo box using its path WpfApplication/Simple_Controls/Combobox_2nd with the keyword findWindowsObject, then calls Windows.selectOptionByLabel(...) with a 1-second timeout to choose the labeled item.
// Select item
// label "Item 1"
// Combo box is located via findWindowsObject method: findWindowsObject('WpfApplication/Simple_Controls/Combobox_2nd')
// timeout 1 second
import com.kms.katalon.core.windows.keyword.WindowsBuiltinKeywords as Windows
import static com.kms.katalon.core.testobject.ObjectRepository.findWindowsObject
Windows.selectOptionByLabel(findWindowsObject('WpfApplication/Simple_Controls/Combobox_2nd'), 'Item 1', 1)