Get element attribute Version 12 (Java)

Action group: Browsers


Description

Gets the value of the specified element attribute

Action icon

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
ContextAction context for working with the browserRobin.SeleniumBrowser contextYes
ElementElement for interactionRobin.WebElement
Yes
Attribute name from the listAttribute name selected from possible value listRobin.String
Yes
Attribute nameUser-defined attribute nameRobin.String
No
Results
ResultAttribute valueRobin.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

  1. Assemble a robot scheme consisting of actions: 

  2. Set the "Open Browser" action parameter.

  3. Set the parameters of the "Get element attribute" action. To create an element, use WebSpy (see section Create Web-elements). 

  4. Set the parameters for the "Close Browser" action. 
  5. Click on the "Start" button in the top panel. 

Result

The program robot completed successfully. The text value of the element has been received. 

  • Нет меток