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.
Syntax
Input Value: <ObjectType>;<VisibleText(optional)>;<Index>;<AttributeName>;<css>(optional)
<ObjectType> (Required)
Specify the type of custom element from which the attribute value is to be retrieved.
<VisibleText> (Optional)
Specify the visible text of the element, used to identify the target element when multiple elements of the same type exist.
<Index> (Required)
Specify the index of the element to identify the target element when multiple matching elements exist.
<AttributeName> (Required)
Specify the name of the attribute whose value is to be retrieved.
<css> (Optional)
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)
<Dynamic Variable> (Optional)
Stores the retrieved attribute value.
<Dynamic Variable> (Optional)
Stores the status as True or False.
Example: Getting an Object's Attribute Value
Action: Get Object Attribute Value
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
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.
Last updated