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
Свойство | Описание | Тип | Пример заполнения | Обязательность заполнения поля |
Параметры | ||||
Контекст | Контекст действия для работы с браузером. | Robin.Selenium | Контекст браузера | Да |
Элемент | Элемент для взаимодействия | Robin.WebElement | Да | |
Выбор названия атрибута | Выбранное имя атрибута из списка возможных значений | Robin.String | Да | |
Имя атрибута | Имя атрибута, задаваемое пользователем. | Robin.String | Нет | |
Значение атрибута | Значение атрибута | Robin.Object | Нет |
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 (checked).
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.