Reputation: 395
I am trying to get xpath by index and i am not making an progress. protractor says "that the element has more than one element is found for locator choosing the 1st one". however I want to make sure that the 1st one is selected intentionally screen shot below:
My code: that is not working:
I tried the following site nothing works:
https://devhints.io/xpath
xpath get element by index
Any help would be appreciated.
Upvotes: 0
Views: 1593
Reputation: 2858
var payroll = element.all(by.xpath('//*[text()="Payroll"]')).first();
Upvotes: 1