Get Electron Attribute

The Get Electron Attribute block is used to retrieve the value of a specific attribute from an element in an Electron-based application. It is typically used to extract dynamic values such as IDs, labels, paths, or flags from UI elements during test execution.

This block is useful when validating application state, capturing metadata, or branching logic based on an attribute’s presence or value. 

image-20251120-094343.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 Electron Attribute onto the canvas.

  2. Connect the Source element and specify the Attribute name.

  3. Use the Attribute value or Exists outputs as needed in your flow.

  4. Run the flow when it’s ready.

Building block parameters

Parameters
  • Block header: The green input connector triggers the block to begin execution. The green output connector triggers when an Electron attribute has been successfully fetched. You can rename the block title by double-clicking the header text and typing a new title.

  • Source element: Defines the element the attribute is retrieved from. You can either define the source directly or select the Element option to limit the Electron element locator to only work inside the specified source element.

  • Attribute name: The name of the attribute to retrieve from the source element (for example src when the source element is a previously found <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. This output can be connected and used for branching or validation.

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.

Electron Troubleshooting

Guidance and solutions for diagnosing and resolving issues related to Electron-based automation and environments