Steering UIA 3.0 Controls

UIA 3.0 Modules are created by using Tosca XScan. Please follow the steps below to create Modules with the Tosca UIA Engine:

  1. In Tosca Commander, right-click on a Module folder or use the dynamic menu Modules and select Scan->Application.

  2. Right-click onto the screen you would like to steer and choose UIA from the appearing menu.

Selecting the UIA Engine in Tosca XScan

For further details, please refer to chapter "Create Modules by scanning".

The following standard controls can be steered as described in chapter "Steering Controls":

This topic describes how to steer UIA Engine 3.0-specific controls.

Steering parameter PreventUIAChildrenRecursion

Specify whether to check for infinite loops when navigating through the hierarchical structure of UI elements:

  • If set to True, Tosca runs an additional check to prevent recursion. We recommend that you use this value if you encounter issues with infinite recursions.

  • If set to False, Tosca doesn't run this check, which speeds up your test runs. This is the default setting.

If you don't explicitly add the parameter PreventUIAChildrenRecursion to your Module, Tosca acts as if it's set to False.

Alternatively, you can add PreventUIAChildrenRecursion as test configuration parameter (TCP).

ComboBox

You can scan UIA ComboBoxes with Tosca XScan and steer them like standard ComboBoxes.

Note that the Tricentis Automation Recording Assistant (Tricentis ARA) can't record UIA ComboBoxes.

ContextMenu

You can steer context menus with the Module TBox Context Menu.

This Module is part of the Standard subset. You can find it under Standard modules->TBox Automation Tools->Basic Windows Operations.

To use the Module TBox Context Menu, the context menu that you want to steer has to be open so Tricentis Tosca can detect it.

In this example, you select the entry Insert->New Image of a context menu which is currently open.

It does so in two different ways:

  • In TestStep TBox Context Menu - Control Hierarchy, you steer the context menu via control hierarchy to select the entry New Image.

  • In TestStep TBox Context Menu - Inline Syntax, you steer the context menu via inline syntax to select the entry New Image.

Different ways to steer a WinForms context menu

Label

Tosca XScan identifies UIA text controls as Labels. Learn how to steer them.

RichTextBox

UIA RichTextBoxes can be scanned with Tosca XScan and they are identified as TextBoxes. This control type is steered as described in chapter "TextBox".

Spinner

UIA spinners can be scanned with Tosca XScan and they are identified as TextBoxes. For further details, please see also chapter "TextBox".

In the example below, the engine verifies whether the value 11:00:00 exists in the spinner Sample Spinner:

UIA Spinner

TabControl

UIA Tab controls can be scanned with Tosca XScan and they are steered as described in chapter "Listbox".

Use TabItems to select individual tabs of a TabControl. To create a TabItem, right-click on a TabControl and choose Create Generic TabItem (see chapter "Generic list items").

In the example below, the engine selects the tab Tasks from the TabControl Tab:

UIA TabControl - selecting a tab

In this example, the engine verifies whether the tab Completed is selected in the TabControl Tab:

UIA Spinner - verifying a tab

Table

UIA GridPattern tables can be scanned with Tosca XScan. For further information on how to steer tables, please see also chapter "Table".

Use embedded TextBox controls to enter text into cells, and embedded ComboBox controls to select values from ComboBoxes. CheckBoxes are selected via embedded CheckBox controls (see chapter "Defining controls in cells").

In the example below, the engine writes the value My text into the first row of the first column:

Table: Entering text