Listbox
There are two different ways to display ListBoxes in Tosca Commanderâ„¢, namely in single-line view and multiline view. The creation of Modules varies for both views.
Single-line view
Single-line ListBoxes are automatically created upon scanning with Tosca XScan.
ActionMode |
Value |
Description |
---|---|---|
Input |
<value> |
Selecting an entry with this value |
Verify |
<value> |
Verifying, if an entry with this value has been selected. If you select multiple entries, please separate all values by semicolons. |
Buffer |
<buffer name> |
This writes the selected entry to a buffer of the specified name. If multiple entries are selected, Tosca will buffer all elements with list separators separately. |
The value Courtesy Car is selected from the ListBox Courtesy car option.
ListBox - single-line view (Input) |
The system verifies whether the value Courtesy Car is selected in the ListBox Courtesy car option.
ListBox - single-line view (Verify) |
Multiline view
Multiline ListBoxes are scanned with Tosca XScan just like ComboBoxes (see "Multiline view").
Generic list items
You can create generic list items to individually steer entries of a ListBox. To do so, perform the following steps:
-
Right-click on a ListBox control which you have scanned with Tosca XScan.
-
From the mini toolbar, select Create Generic List Item
Create a generic list item
This adds an additional generic list item called <Item> to your ListBox control that you can steer individually.
ListBox with additional list items
To create multiple generic list items, repeat the steps above.
Control steering in the TestCase
When a ListBox is steered with multiline view, the ActionMode of the ListBox must be set to Select.
The following properties can be verified with ListBox entries in addition to the general properties:
Property |
Description |
---|---|
Selected |
Indicates if the entry is selected or deselected. |
Text |
Entry name |
The following functions are available for the ListBox entry. If you do not enter a property in the TestStepValue, the property from the Default property column is used:
ActionMode |
Value |
Default property |
Description |
---|---|---|---|
Input |
|
Selected |
Selecting an entry |
Verify |
True, False, <property> |
Selected |
Verifying a value or a property |
Buffer |
<buffer name> |
Selected |
This saves the value true if the entry is selected. If not, false is saved. |
In the example below, the item No Courtesy Car is used to select the ListBox entry No Courtesy Car in the ListBox Courtesy car option. Multiline ListBox - Input |
The property Selected is used to verify whether the item Courtesy Car is selected in the ListBox Courtesy car option. Multiline ListBox - Verify and Selected |
Manipulating ListBox items
To be able to modify the name of a multiline ListBox item, the configuration parameter ExplicitName with the value True must be added to the ModuleAttribute of the required ListBox item (see chapter "Configuration Param").
You can use date and time expressions, regular expressions and random values for defining the items.
Deselecting ListBox items
Tosca allows you to deselect all ListBox items shown in single-line and multiline view simultaneously and to clear your selection in the ListBox.
For this purpose, define the dynamic expression {Clearselection} for the ListBox in the according TestStep and set the ActionMode to Input.
The example below deselects all selected items of the ListBox cars by using the expression {Clearselection}.
Deselecting ListBox items |