Skip to main content
Roberty Studio
RPABrowser

Get Multiple Elements

Get Multiple 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.

An element in the browser​

Searches for the elements straight on the page.

Browser or page ID​

The browser, tab or iframe opening action to search in.

An element already selected​

Searches for the elements inside the scope of a parent element already fetched by a Get element action.

Element ID​

The earlier Get element action to use as the search context.

One item from a selection of multiple elements​

Searches for the elements inside one item of a list captured by a Get Multiple Elements action.

Elements list id​

The Get Multiple Elements action to use as the source list.

Enter the index of the list​

The parent element's position in the list. The index starts at 0.

Element selector​

The CSS selector identifying the elements to fetch, tr.tableRow for example. In An element already selected and One item from a selection of multiple elements modes, the search happens inside the parent element.

Element state​

Only available in An element in the browser mode. The state the elements should be in before they come back: Visible or Invisible/Hidden. Default: Visible.

Timeout​

Only available in An element in the browser mode. How long, in seconds, the robot waits for the elements to reach that state. Default: 120.

Returns​

Javascript code​

js
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 Elements list id field of other actions (List)
  • size — how many elements matched the selector (Number)

Rules and conditions​

  • Element selector is required in every mode. In An element in the browser mode, Browser or page ID has to be filled in too.
  • In An element in the browser mode, the robot waits for the elements to reach the configured state; if the timeout runs out with no element found, the action ends in an error.
  • In An element already selected and One item from a selection of multiple elements modes, size comes back as 0 when nothing matches the selector (no error).
  • The list is indexed from 0 (the first element is at index 0).