Get several elements
Get several elements
Finds and returns a list of every HTML element matching the CSS selector on the browser's page. Useful for iterating over lists, tables and any set of repeated elements.
Options
Select the action
Where to search.
By browser
Finds the elements with a CSS selector on the page.
Browser or page ID
The browser, tab or iframe opening action to search in.
Element selector
The CSS selector identifying the elements to fetch, tr.tableRow for example.
Element state
The state the elements should be in before they come back: Visible, Invisible/hidden, Present in the DOM or Not present in the DOM. Default: Visible.
Timeout
How long, in seconds, the robot waits for the elements to reach that state. Default: 120.
By element
Finds the elements inside the scope of a parent element fetched by a Get element action.
Element ID
The earlier Get element action to use as the search context.
By element list
Finds elements inside one item of a list captured by a Get elements action.
Element list ID
The Get elements action to use as the source list.
The list index
The parent element's position in the list. The index starts at 0.
Returns
Javascript code
actions["action-id"].elements // the HTML elements found (List)
actions["action-id"].size // how many were found (Number)
Field selection
- elements — the HTML elements found on the page, available in the Element list ID field of other actions (List)
- size — how many elements matched the selector (Number)
Rules and conditions
- In By browser mode, Browser or page ID and Element selector are both required.
- size comes back as
0when nothing matches the selector — it does not raise an error. - The list is indexed from
0(the first element is at index 0).