I am trying to find out the XPATH. I am getting 30 matches for an element.
I tried using last(), position(), indexing[], child, parent, following:siblings, preceding:siblings, absolute XPATH is also not working, how to achieve this.
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It only takes a minute to sign up.
Sign up to join this communityI am trying to find out the XPATH. I am getting 30 matches for an element.
I tried using last(), position(), indexing[], child, parent, following:siblings, preceding:siblings, absolute XPATH is also not working, how to achieve this.
You're on the right track, but I've only recently discovered myself the solution to this type of problem. Surround the main xpath with parenthesis, place the subscript AFTER.
Assuming that your basic xpath is correct, the following should isolate element 1:
(//span[@class='cursor']//*[local-name()='svg'][@class='excel-document'])[1]
Absolute xpath:
html/body/div[1]/section/div[1]/div/div/div/div[1]/div/div/div/div/div[3]/div[1]/div/h4[1]/b
Relative xpath:
//*[@class='featured-box']//*[text()='Testing']
Might be the syntax you are using is wrong