Find UI Element

The Find UI Element block searches for a UI element (for example, a button or text box) in an already open application window when working with Desktop UI automation. If the element is found, the block returns details such as the found element itself and its position and area on screen, which can be reused in later blocks.

When fully expanded, the Find UI Element block displays the following properties:

image-20260127-125615.png

Note: The screenshot on this page uses the Elegance Design, introduced in 2025.3. If you are using an earlier version, your layout may look different.

Quick-start

  1. Drag Find UI Element onto the canvas.

  2. Connect the block in the flow and set the required parameter Select UI Element. You can optionally adjust other parameters such as Source element, Use occurred, and Default timeout if needed.

  3. Run the flow when it’s ready.

Building block parameters

Parameters
  • Block header: Shows the current title of the Find UI Element block. You can rename it by double-clicking the header and typing a new title.
    The green input connector triggers the block when the flow reaches it, and the green output connector triggers when the UI element has been successfully found.

  • Select UI Element: Contains the locator for the UI element to find. You can capture a locator by selecting Capture new element, and later update it using Edit element, or remove it using Clear element.
    This parameter is mandatory.

  • Found element: Returns the UI element that was found in the application window. This output can be reused in other blocks (for example, as a Source element to narrow a later search). If the element is not found, this output is empty.

  • Not found: Triggers if the UI element is not found within the configured timeout. If nothing is connected to this output and the element is not found, the case ends with status Fail. This output is typically used to branch the flow for error handling or recovery.

  • Position found: Returns the screen position where the UI element was found as X, Y coordinates relative to the top-left corner of the screen (typically 0, 0). In multi-screen setups, coordinates can be negative or exceed a single screen’s resolution depending on where the window is located. UI elements that are not visible can return position 0, 0.

  • Area found: Returns the screen area occupied by the found UI element as X, Y, Width, Height, starting from the upper-leftmost pixel. In multi-screen setups, values can be negative or exceed a single screen’s resolution depending on where the window is located.

  • Source element: Restricts the search to only occur inside the provided source element instead of searching broadly in the application window. This is useful when you want to work within a specific container, such as finding a cell inside a previously captured table row.

  • Use occurred: Selects which occurrence to use if more than one matching UI element is found. If you select All, the block iterates through each occurrence and exposes additional iteration-related outputs (such as the current index and a completion trigger) while it runs.

  • Count: Returns the total number of found UI elements that match the locator.

  • Default timeout: Controls whether the block uses a fixed timeout or the flow’s default timeout. If the Default timeout checkbox is not selected, the timeout is 10 seconds. If it is selected, the Default timeout value from the flow settings is applied.

  • Scroll to find: Enables scrolling while searching for the UI element when a value other than None is selected. This can be useful in scrollable content where elements load asynchronously.

  • Await no changes: When selected, the block waits for the screen to stop changing (within the configured wait behavior) before it begins searching for the specified UI element.

Resources

Topic

Description

Flows FAQ

Common questions about creating, running, and managing flows in Leapwork.

Flows Troubleshooting

Guidelines and solutions for identifying and fixing issues that occur when building or running flows in Leapwork.

Strategy Editor

Guidelines for understanding and using the Strategy Editor in Leapwork to define, refine, and validate robust locator strategies for UI elements using DOM structure, tokens, and wildcards.