Get element attribute Version 12 (Java)
Action group: Browsers
Description
Gets the value of the specified element attribute
Action icon
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
Context | Action context for working with the browser | Robin.Selenium | Browser context | Yes |
Element | Element for interaction | Robin.WebElement | Yes | |
Attribute name from the list | Attribute name selected from possible value list | Robin.String | Yes | |
Attribute name | User-defined attribute name | Robin.String | No | |
Results | ||||
Result | Attribute value | Robin.Object |
Special conditions of use
For checkbox and radio button, the checked attribute defines the activation state.
For the list and combo box, the selected attribute of the option element determines the activation state.
For input (text) and text area elements, the value attribute value defines the text content.
Example of use
Task
Go to https://practice-automation.com/form-fields/ and get the text value of the attribute
Solution
Use the actions "Open Browser", "Get element attribute", "Close browser".
Implementation
- Assemble a robot scheme consisting of actions:
- Set the "Open Browser" action parameter.
- Set the parameters of the "Get element attribute" action. To create an element, use WebSpy (see section Create Web-elements).
- Set the parameters for the "Close Browser" action.
- Click on the "Start" button in the top panel.
Result
The program robot completed successfully. The text value of the element has been received.
Обзор
Инструменты контента