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
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 | |
Select attribute name | Selected attribute name from possible value list | Robin.String | Yes | |
Aattribute name | User-supplied attribute name. | Robin.String | No | |
Attribute value | Attribute value | Robin.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:
Attribute | Purpose |
---|---|
Value | When 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 - selected | When this attribute is selected, it is possible to set the element as "selected". The element will be selected. |
Formatted HTML text | When 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 value | When 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
- Assemble a robot scheme with the actions.
- Set the "Open Browser" action parameters.
- Set the "Set element attribute" action parameters. To create an element use the WebSpy tool (see section Create Web-element).
- Click "Start" in the top panel.
Result
The program robot completed successfully.
Обзор
Инструменты контента