XPath: Using Index
Xpath Index:-
Indexes are useful when you want to select a specific element from a group of elements with the same tag name. By using an index, you can target the exact element you need.
In the following example, the XPath targets an input field labeled 'Full name.' The first input tag is ignored, and the second input tag is selected because of the index specified. This method is particularly helpful when working with data in tables or lists. For instance, if you have multiple rows, you can use an index to refer to a specific row.
Example 1: XPath= //div[@class= 'col-sm-12 google-sign-form']/input[2]