ComboBox

There are two different ways to display ComboBoxes in Tosca Commanderâ„¢, namely in single-line view and multiline view. The creation of Modules varies for both views.

Single-line view

Single-line ComboBoxes are automatically created upon scanning with Tosca XScan. In the Modules section, all ComboBox entries can be entered manually into the ValueRange column if separated by semicolons. The entries can be selected from a list in the Value column of the according TestStepValue.

ActionMode

Value

Description

Input

<value>

Selecting an entry

Verify

<value>

Verifying, if an entry is selected

Buffer

<buffername>

This writes the selected entry to a buffer of the specified name.

The value Automobile or Trailer is selected from the ComboBox Type of vehicle.

ComboBox - single-line view

The system verifies whether the specified value Automobile or Trailer is selected in the combobox Type of vehicle.

Verifying a value in the single-line combobox

Multiline view

If ComboBoxes are used with multiline view, users can verify the properties of each individual list item.

In order to display multiline ComboBoxes, structured items can be created by using Tosca XScan, or a generic item can be manually created. For further information, please see also the sections below.

Creating structured list items

An XModuleAttribute with a unique technical ID is created for each list item to be steered.

  1. Scan the required control as described in chapter "Scan Modules".

  2. Click on the Filter button in the Home menu.

  3. Select the control types Combobox and ListItem from the Filter window, and select the visibility option Visible and Invisible. The list items are shown in the tree view.

Defining filters for structured list items

  1. Select all list items which should be transferred to the Module.

View of ComboBox entries in the Tosca XScan window

  1. The list items must have a unique ID. This allows additional properties to be selected, for instance the Text property.

Adding a property for unique identification purposes

Generic list items

You can create generic list items to individually steer entries of a ComboBox. To do so, perform the following steps:

  1. Right-click on a ComboBox control which you have scanned with Tosca XScan.

  2. 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 ComboBox control that you can steer individually.

ListBox with additional list items

To create multiple generic list items, repeat the steps above.

Steering in the TestCase

When ComboBoxes are steered with multiline view, the ActionMode must be set to Select.

The following properties can be verified with ComboBox entries in addition to the general properties:

Property

Description

Selected

Indicates if the entry is selected or deselected.

Text

Entry name

The functions listed below are available for ComboBox entries. 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

<buffername>

Selected

This saves the value true if the entry is selected. If not, false is saved.

In the example below, Tosca uses the list item Trailer in order to select the item of the same name from the Combobox Type of vehicle.

Multiline combobox - structured list item Input

Multiline combobox - generic list item Input

The example below verifies whether the entry Trailer is selected in the combobox Type of vehicle.

Multiline combobox - structured list item Verify

You can also use the property Selected to verify whether the entry is selected.

Multiline combobox - generic list item Verify and Selected