> For the complete documentation index, see [llms.txt](https://docs.avoautomation.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avoautomation.com/avo-assure/actions/custom/get-object-attribute-value.md).

# Get Object Attribute Value

This pre-built action is located under the **@Custom** element type. The functionality of this action in Avo Assure is to retrieve the attribute value of the object based on the input provided and stores the result in a dynamic variable.&#x20;

## **Syntax**&#x20;

**Input Value:** `<ObjectType>;<VisibleText(optional)>;<Index>;<AttributeName>;<css>(optional)`

{% hint style="info" %}
**Note:**

* Ensure that the specified element exists and is accessible before executing the Action.
* The element must be visible and loaded completely for successful execution.
* If css is specified, the Action retrieves the value of the given CSS property instead of a standard HTML/DOM attribute.
  {% endhint %}

| Argument                              | Description                                                                                                                 |
| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| <p>\<ObjectType><br>(Required)</p>    | Specify the type of custom element from which the attribute value is to be retrieved.                                       |
| <p>\<VisibleText><br>(Optional)</p>   | Specify the visible text of the element, used to identify the target element when multiple elements of the same type exist. |
| <p>\<Index><br>(Required)</p>         | Specify the index of the element to identify the target element when multiple matching elements exist.                      |
| <p>\<AttributeName><br>(Required)</p> | Specify the name of the attribute whose value is to be retrieved.                                                           |
| <p>\<css><br>(Optional)</p>           | Specify this flag if the \<AttributeName> refers to a CSS property rather than a standard element attribute.                |

**Output Value:** `<Dynamic Variable> (Optional); <Dynamic Variable> (Optional)`

| Argument                                   | Description                           |
| ------------------------------------------ | ------------------------------------- |
| <p>\<Dynamic Variable><br>(Optional)</p>   | Stores the retrieved attribute value. |
| <p>\<Dynamic Variable> <br>(Optional) </p> | Stores the status as True or False.   |

### **Example: Getting an Object's Attribute Value**

* **Action:** Get Object Attribute Value&#x20;
* **Input Value:** button;Login;0;class
  * The first argument **button** specifies the object type of the custom element.
  * The second argument **Login** specifies the visible text on the element.
  * The third argument **0** specifies the index of the element.
  * The fourth argument **class** specifies the name of the attribute to retrieve.
* **Output Value:** {Attribute Value};{Status}
  * The result of the Get Object Attribute Value action is stored in the {Attribute Value} and {Status} dynamic variables, with the following possible values:
    * {Attribute Value} stores the actual value of the specified attribute.
    * **True:** The attribute value is successfully retrieved from the specified element.
    * **False:** The Action fails due to an invalid object type, unmatched visible text, incorrect index, non-existent attribute, or the element being inaccessible.
* **Logical Explanation**: The **Get Object Attribute Value** action reads the object type, visible text (if provided), index, attribute name, and css flag (if provided) from the Input Value field. During execution, Avo Assure identifies the specified custom element and retrieves the value of the specified attribute (either a standard attribute or a CSS property, based on the css flag). The Action then returns the retrieved value and execution status in the specified dynamic variables.

#### Knowledge Bites

| Scenario                                             | Input Value      | Result                                                                                    |
| ---------------------------------------------------- | ---------------- | ----------------------------------------------------------------------------------------- |
| Get a standard HTML attribute                        | TextBox;;1;value | Retrieves the value of the value attribute from the first matching TextBox element.       |
| Get attribute using visible text to narrow selection | Link;Home;1;href | Retrieves the value of the href attribute from the Link element with visible text "Home". |
| Get a CSS property value                             | Div;;1;color;css | Retrieves the value of the color CSS property from the Div element.                       |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avoautomation.com/avo-assure/actions/custom/get-object-attribute-value.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
