Index
Please note that this tool is classified as a Legacy tool. We recommend transitioning to our updated solutions to maintain optimal performance and security in your workflows. For more information on this matter, please reach out to technical support .
If an Element appears more than once on the screen, you can differentiate between its instances by index - with "0" referring to the Highest and Left-most, and as it goes Down and Right - the number grows.
Best practice: As Index differs between visible elements on the screen, it can change according to resolution or page state. It is recommended not to rely on Index to identify elements.
A good approach for element identification is to keep index value = 0 all time while finding a unique identifier for the element.
Example
For the following image Arrow which appears on the IMDB application, there are 4 visible instances. To differ between them using Image recognition we will use the element from the repository with the Index as shown on the reflection.
To click the Arrow next to the ‘Your Ratings’ label we will use Index = 1.
Index on XPath
Index for xpath identification is similar in nature except it is not zero based
Example
In the below screenshot, there are 4 buttons on the page having same parent name.
In order to identify the first button, we will use index 1.
xpath=//*[@class='UIRoundedRectButton'][1]