Set element attribute Version 11 (Java)

Action group: Browsers


Description

The action sets the value of the specified element attribute

Action icon

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
ContextAction context for working with the browser.Robin.SeleniumBrowser contextYes
ElementElement for interactionRobin.WebElement
Yes
Select attribute nameSelected attribute name from possible value listRobin.String
Yes
Aattribute nameUser-supplied attribute name.Robin.String
No
Attribute valueAttribute valueRobin.Object
No

Special conditions of use

To activate the checkbox and radio button, assign the checked attribute to true.

To activate option, assign the value true to the selected attribute.

For elements such as input (text) and text area, the value of the value attribute defines the text content.

Attribute list:

AttributePurpose
ValueWhen selecting this attribute it is possible to set the value of the element. For this purpose it is necessary to fill in the field "Attribute value".
Marked status - checked

When selecting this attribute it is possible to set the marked state of the element, e.g. checkbox activation.

Selected state - selectedWhen this attribute is selected, it is possible to set the element as "selected". The element will be selected.
Formatted HTML textWhen this attribute is selected, it is possible to set the attribute of an element with formatted HTML text. Learn more about HTML text: https://html5book.ru/html-text/
Text valueWhen selecting this attribute it is possible to set the text value of the element. For this purpose it is necessary to fill in the field "Attribute name".

Example of use

Task

Go to the website and set the element attribute = checked state. 


Solution

Use the "Open Browser", "Set element attribute" actions.

Implementation

  1. Assemble a robot scheme with the actions.

  2. Set the "Open Browser" action parameters.

  3. Set the "Set element attribute" action parameters. To create an element use the WebSpy tool (see section Create Web-element). 
     
  4. Click "Start" in the top panel.

Result

The program robot completed successfully.


  • Нет меток