TabControl
TabControls can either be shown in single-line or multiline view in Tosca TBox.
Single-line view
Single-line TabControls are automatically created upon scanning with Tosca XScan.
ActionMode |
Value |
Description |
---|---|---|
Input |
<name> |
Selects the tab with this name. |
Verify |
<name> |
Verifies whether the tab with this name has been selected. |
Buffer |
<buffer name> |
This saves the selected tab to a buffer of the specified name. |
The engine selects the tabPage3 tab from the tabControlMain TabControl.
TabControl - Input in single-line view |
The system verifies whether the tabPage3 tab is selected in the tabControlMain TabControl .
TabControl - Verify in single-line view |
Multiline view
In order to display TabControls in multiline view, you can build structured entries with Tosca XScan.
Depending on the engine used for scanning, Tosca allows you to:
-
select the TabControl and each required tab. Each tab is copied to the Module as a TabItem.
-
select the TabControl and create tabs manually in the form of ModuleAttributes (see chapter "Creating generic Tab Items").
The following properties can be verified with TabControl tabs in addition to the general properties:
Property |
Description |
---|---|
Closeable |
Indicates with the value True that the tab can be closed. Otherwise, the value False is used. |
Selected |
Indicates if the tab is selected or deselected. |
Text |
Tab name |
If multiline TabControls are steered, the ActionMode of the TabControl must be set to Select.
The following functions are available for the TabControl tabs. 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 |
<empty value> <mouse action> {CLOSE} |
Selected |
Selects the tab. Selects the tab using the specified mouse action. Closes the closeable tab. |
Verify |
True, False, <property> |
Selected |
Verifies a value or a property. |
Buffer |
<buffer name> |
Selected |
This saves the value True if the entry is selected. Otherwise, False is saved. |
In the example shown below, the engine selects the tab Tab1 in the TabControl TabPane:
Multiline TabControl - Input |
This example verifies whether the tab Tab2 is visible in the test application using the value Visible = True:
Multiline TabControl- Verify property |
Creating generic Tab Items
Tab Items are used to steer TabControl tabs.
Tab Items can be used repeatedly, depending on the number of Tab Items required.
-
Scan the TabControl using Scan Modules.
-
Right-click onto the TabControl and select Create Generic Tab Item from the context menu to create a new Tab Item.
Creating a generic Tab Item
A new Tab Item called <Item> of the BusinessType TabItem is created. You can adjust the TabItem name to the name of the tab in your application either in the Module itself or in the Name column of the TestStepValue.
Created Tab Items
Manipulating Tab Items
To be able to modify the name of a TabControl tab, add the configuration param ExplicitName with the value True to the ModuleAttribute of the according Tab Item (see chapter "Configuration Param").
You can use date and time expressions, regular expressions and random values to define the tabs.