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

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
ContextAction context for working with the browserRobin.SeleniumBrowser contextYes
HTML-elementHTML 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.BooleantrueNo
Results
List of found elementsCollection with a list of found elementsRobin.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

  1. Assemble a robot scheme consisting of actions:
  2. Set the parameters for the "Open Browser" action. 
  3. Set the parameters for the "Get Elements" action. 

  4. Set parameters for the "Get value by index" action.
  5. Set the parameters for the "Send Click" action. 
  6. Click on the "Start" button in the top panel. 

Result

The program robot completed successfully. 


  • Нет меток