Skip to content

Get Style Attribute of Locator: getStyleAttribute

The Get Style Attribute of Locator function retrieves the specified CSS style attribute (e.g., color, background color, or border color) of a UI element identified by a locator. This function is useful for verifying UI properties in automation workflows.

Example Usage: Suppose you want to check the background color of a button on the login page to ensure it meets UI design requirements.

Steps to Configure:

  1. Select SET from the Action dropdown.
  2. In the Element Key field, enter a variable name to store the retrieved attribute value (e.g., ButtonColor).
  3. In the Parameter section, click Form and select Functions from the dropdown.
  4. Choose Get Style Attribute of Locator from the list of functions.
  5. Provide the following values:
    • PageName: Enter the name of the page where the element is located (e.g., LoginPage). Ensure that the page name is already defined before using this function.
    • LocatorKey: Enter the locator key to identify the UI element (e.g., LoginButton).
    • Attribute: Select the style attribute to retrieve from the dropdown. The available options are:
      • Color
      • Background-color
      • Border-color
  6. Click Save.

v7_functions_get_style_attributes

Expected Outcome

  • The retrieved style attribute value (e.g., rgb(0, 128, 255)) is stored in the specified variable.
  • This value can be used in subsequent steps using the syntax ${VariableName}

(e.g., ${ButtonColor}).

Last updated: Oct 8, 2025
Back To Top