Tips and tricks Best practice guides, FAQ & more
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 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.
By default, the “Define” method is selected as source for Desktop application under test and it needs to define the criteria based on options available (mentioned below), user can also choose “Element” and provide 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.
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.
Choose one of the three option to define where condition (mentioned below)
This will attempt to find a window based on the window’s title.
Process Name. This will attempt to find a window based on the window’s Process Name.
Execution path. This will attempt to find a window based on the window’s Execution path.
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:
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.
This will attempt to find a UI window where the text entered below is contained in the Title, Process Name or Execution path.
Starts with. This will attempt to find a window where the Title, Process Name or Execution path starts with the text entered below.
Ends with. This will attempt to find a window where the Title, Process Name or Execution path ends with the text entered below.
The text to be used to find the desired window.
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.
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.
If the 'Default Timeout' property checkbox is not selected, then the timeout value is 10 seconds. If the 'Default Timeout' property checkbox is selected, then the 'Default timeout' value selected in the flow settings will be applicable.
The maximum time spent searching for the Application UI element before giving up and triggering “Not found” (see above).
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.
©2023, LEAPWORK. All rights reserved. Legal