Skip to content

Get Element Index Action: GETINDEX

The Get Element Index Action identifies all elements that match a specified locator, searches for an element containing a specific value, and stores its index in a variable. This function is useful when dealing with lists, dropdown menus, or repeated UI components, where identifying the position of an element dynamically is required.

Example: Suppose you have a dropdown menu listing different product categories:

IndexCategory Name
0Home Appliances
1Fashion
2Books
3Electronics

If you need to find the index of “Electronics”, the Get Element Index Action will return 3.

Steps to configure:

  1. From the Action dropdown, select Get Element Index.
  2. In the Screen Name field, enter the name of the screen where the dropdown exists (e.g., “Product Filter Screen”).
  3. In the Element Key field, choose the locator for the group of elements you want to search through (e.g., Category Dropdown).
  4. In the Parameters field, type the value you want to match (e.g., Electronics).
  5. Click Save.

Note: While the steps for adding an action are identical in both views, the display of the steps changes:

scrn-get-element-index-action-tabular-view
Tabular View
scrn-get-element-index-action-card-view
Card View

Expected outcome on Execution:

  • If “Electronics” is found in the dropdown list, its index (3) will be stored in variable defined in the Element Key field (e.g., Category Dropdown).
  • This value can be retrieved using the syntax ${Variable Name} (e.g., ${Category Dropdown}) and used later in the automation.

Back To Top