Feel free to try out any of the following xpath expressions
Remember to use indexing once you have completed your selection of xpath
Hint:- Indexing always starts from 1
For example, if you need to click on the second view link button
, use the xpath below.
//a[text()='View'][2]
OR
//a[@class='btn btn-lawa btn-primary btn-primary-lawa'][text()='View'][2]
Explanation of xpath:- Utilize the class
attribute in conjunction with the text
method within the <a>
tag.
OR
If you wish to click on the first view link button
, you can use the following xpath.
//a[text()='View'][1]
OR
//a[@class='btn btn-lawa btn-primary btn-primary-lawa'][text()='View'][1]