Find Web Element

The Find Web Element building block searches for a web element (for example, a div) in an already open browser window. It outputs the found element and related details (position, area, attributes, visibility, etc.), and it triggers Not found if the element cannot be located within the configured timeout behavior.

This block only works with browser windows opened using Start Web Browser (or their child windows).

Fully expanded, the Find Web Element block shows the following properties:

image-20260205-094111.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 Web Element onto the canvas.

  2. Connect the block in the flow and specify Select Web Element. Optionally set Source element or Browser window, and adjust Scroll to find / await options and timeout-related settings if needed.

  3. Run the flow when it’s ready.

Building block parameters

Parameters
  • Block header: The green input connector triggers the block to start executing. The green output connector triggers when the web element has been successfully found. You can rename the block by double-clicking the header text and typing a new title.

  • Select Web Element: Contains the locator for the web element to be found. Capture a locator by right-clicking and selecting Capture new web element. You can edit it via Edit web element, or clear it via Clear web element.
    See the many different Learning Center video examples of how this works.

  • Found element: Outputs the found web element in the browser window. You can reuse it as a Source element in other blocks to narrow down later searches (for example, searching for tr/td inside a table).

  • Not found: Triggers if the web element is not found before the timeout behavior completes. This is typically used to branch the execution flow or explicitly fail a case by linking it to a Fail block.

  • Position found: Outputs the browser canvas position where the element was found as X, Y coordinates. The top-left corner of the browser canvas is 0, 0. Elements that are not visible (for example hidden by CSS) typically report 0, 0. Use the expander to work with X and Y separately.

  • Area found: Outputs the browser canvas position and size of the found element as X, Y, Width, Height, starting from the upper-leftmost pixel. The top-left corner is 0, 0. Use the expander to work with position/size and nested sub-properties separately.

  • Attributes: Outputs all attributes on the found element as key–value pairs (including standard HTML attributes like class, style, href, and custom data-xxx attributes). If you only need a specific attribute, Get Web Attribute can be a better fit.

  • CSS values: Outputs values from the element’s HTML style information (for example color, font-family, font-size, width/height, borders). If no style values are present, this output is blank.

  • Visible: Returns True if the found web element is visible.

  • Tag name: Outputs the tag name of the found element (for example div, tr, button, input).

  • Source element: Limits the search to only occur inside the provided source element. This is useful when you first find a container (like a table) and then search inside it.

  • Browser window: Specifies which browser window to search in. Multiple browser windows are not supported by Selenium Grid or external cloud providers such as Sauce Labs and BrowserStack.

  • Use occurred: Selects which occurrence to use if multiple matching elements are found. Select All to iterate through all occurrences.

    • Current index: Outputs the current index while iterating through occurrences.

    • Completed: Triggers when all occurrences have been iterated.

  • Count: Outputs the total number of found web elements that match the locator.

  • Default timeout: Controls whether the block uses the default timeout from the flow settings or a custom timeout value.

  • Timeout (sec): Sets the maximum time spent searching for the web element before the block gives up and triggers Not found. This field is used when Default timeout is not selected.
    Note: All cases have a global timeout 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.

  • Scroll to find: When set to a value other than None, the block scrolls while searching for the element. This is useful in scrollable pages where elements load asynchronously (for example infinite scroll).

    • Max repeats: The maximum number of times to perform a scroll before giving up.

    • Amount: How much scrolling is performed on each repeat.

    • Delay (sec): The delay in seconds between each scroll amount.

  • Require valid imgs: When enabled, locators targeting images (img tags) are additionally validated to ensure the image loads correctly. Leapwork does this by sending an HTTP request to the image source and validating that a 200 response is returned.

  • Scroll into view: When enabled, any found web element is automatically scrolled into view.

  • Await not found: When enabled, the block assumes the element is currently present and waits until it can no longer be found before proceeding. This can be useful when waiting for a “Loading…” message to disappear.

  • Await DOM change: Delays searching until there have been no changes to the page’s DOM for a specified period (for example, three seconds). Regardless of this checkbox, the search proceeds after waiting a maximum of 30 seconds.

    • Await Timeout: The number of seconds the DOM must have had no changes before proceeding.

  • Await Requests: Delays searching until there have been no active XHR requests for a specified period (for example, three seconds). This is useful for apps that update heavily in the background (including Microsoft Dynamics 365 and Salesforce). Regardless of this checkbox, the search proceeds after waiting a maximum of 30 seconds.

    • Await Timeout: The number of seconds no XHR requests must have been active before proceeding.

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.