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

Creating generic list items

A list item that can be generated repeatedly, depending on the required number of list items, is created. List items do not need a unique ID.

  1. Scan the ComboBox by using Tosca XScan.

  2. After scanning the ComboBox, create a list item for this ComboBox by selecting the option Create ModuleAttribute from its context menu.

  3. Right-click on the list item and select Create Configuration Param from the context menu. Create the following configuration params:

    • The BusinessAssociation param must have the value Items.

    • The ExplicitName param must have the value True. This allows unique names to be assigned to each list item in the TestCase. You can also use date and time expressions, regular expressions and random values for the names.

    • The Engine param must have the value of the engine you are using, e.g. Html.
  4. Make sure the value of the BusinessType param is ListItem.

Parameter of a list item

There are two ways to define several list items in the TestCase: the list item can either be copied and renamed in the TestCase or the value 0-n can be specified as a value of the property Cardinality.

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