Use UI Window

A Use UI Window building block is used to switch focus to a specific UI window when working with Desktop UI automation.

Fully expanded, the Use UI Window block shows the following properties:

The Block Header (“Use UI Window”)

The green input connector in the header is used to trigger the block to start executing.

The green output connector in the header triggers when the UI element has been successfully found.

The title of the block (“Use UI Window”) can be changed by double-clicking on it and typing in a new title.

Source

By default, the “Element” method is selected as source for Desktop application under test, user can also “Define” the criteria based on options available (mentioned below)

Source element

By setting this property, the UI element locator will work inside the provided source element, instead of working on a captured element.

This means it’s possible to capture a row in a table in one building block, and by using the source property making it easy to find and click a particular cell or field in that exact row.

Define

This will attempt to find a window based on user defined criteria.

Add Condition (mandatory with “Define”)

You can add multiple conditions to find desired window using “Add condition” button.

Where (mandatory with “Define”)

Choose one of the three option to define where condition (mentioned below)

  1. This will attempt to find a window based on the window’s title.
  2. Process Name. This will attempt to find a window based on the window’s Process Name.
  3. Execution path. This will attempt to find a window based on the window’s Execution path.

Method (mandatory with “Define”)

Select condition to use when attempting to find the desired UI window by either by Title, Process Name or Execution path. The condition options are:

  1. This will attempt to find a UI window where there is an exact match between the Title, Process Name or Execution path and the text entered below.
  2. This will attempt to find a UI window where the text entered below is contained in the Title, Process Name or Execution path.
  3. Starts with. This will attempt to find a window where the Title, Process Name or Execution path starts with the text entered below.
  4. Ends with. This will attempt to find a window where the Title, Process Name or Execution path ends with the text entered below.

Value (mandatory with “Define”)

The text to be used to find the desired window.

Not found

This green output connector triggers if the UI element is not found within the time specified in the timeout field (see below). If no building blocks are attached to this connector and the element is not found, then the case will end in status Fail.

This connector can be used to branch the execution of the flow depending on whether the element is found or not.

Window

Once desktop application window is found and focus is set, this property contains a handle to the window. This can be used in cases where multiple application windows are opened during a case run, to direct other building blocks to use a specific window.

Timeout

The maximum time spent searching for the Application UI element before giving up and triggering “Not found” (see above).

The default value is 10 seconds.

Note: All cases have a “global timeout” that can be configured in the “Settings” panel. This is unrelated to the timeout of a single building block. However, a running case will automatically be cancelled if it runs for longer than the global timeout.

Author: Praveen Kumar, March 23, 2017.