Get Web Attribute

The Get Web Attribute block retrieves the value of a specific HTML attribute from a web element, typically found using the Find Web Element block. This block only works within browser windows opened using the Start Web Browser block or one of its child windows.

It is often used to extract dynamic properties such as href, src, alt, title, or checked from web elements during test execution.

Fully expanded, the Get Web Attribute block shows the following properties:

image-20251113-092651.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 Get Web Attribute onto the canvas.

  2. Connect Source element.

  3. Run the flow when it’s ready.

Building block parameters

Parameters
  • Block header: You can rename the block title (“Get Web Attribute”) by double-clicking it and typing a new title.

  • Source element: The element the attribute will be read from. This is typically connected from a previous block’s Found element (for example from Find Web Element).

  • Attribute name: The name of the HTML attribute to retrieve from the source element (for example, src when the source element is an <img> tag).

  • Attribute value: Contains the retrieved attribute value. This output can be connected and used in other building blocks.

  • Exists: Returns True if the attribute exists and False if it does not. Note that some HTML attributes can exist without having a value (for example a checked checkbox can include a checked attribute with no value).

  • Browser window: Makes the block use a specific browser window. Multiple browser windows are not supported by Selenium Grid or external cloud providers such as Sauce Labs and BrowserStack.

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.