Get Elements Version 14 (Java)
Action group: Browsers
Description
The action returns a list of HTML elements according to the specified criteria.
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 |
HTML-element | HTML element that will define the mechanism used to locate elements within a document. Required. | Robin.WebElement | Yes | |
With xpath and cssselector? | If the parameter value is true, then found elements will contain xpath and cssselector. Note: JS script is used. | Robin.Boolean | true | No |
Results | ||||
List of found elements | Collection with a list of found elements | Robin.Collection |
Special conditions of use
The action returns a collection of web elements (for example, a web element with xpath //a - all links on the page, //li - all items in a numbered/labeled list on the page).
In order to further work with the received web elements, it is necessary to extract them and specify them as an element in other actions (for example, in the Get Text or Send Click actions).
Example of use
Task
Get the page element into a variable of type "Collection", then click on the element, getting it from the collection.
Solution
Use the actions "Open Browser", "Get Elements", "Get value by index", "Send Click".
Implementation
- Assemble a robot scheme consisting of actions:
- Set the parameters for the "Open Browser" action.
- Set the parameters for the "Get Elements" action.
- Set parameters for the "Get value by index" action.
- Set the parameters for the "Send Click" action.
- Click on the "Start" button in the top panel.
Result
The program robot completed successfully.
Обзор
Инструменты контента