Welcome to the Question and Answer site for Software Testing Professionals

You can get your queries resolved from Software Testing Professionals.

Ask a Question

Get answers and give answers to questions from other members.

View All Questions

Get votes and earn points to build your reputation in community.

View Hot Questions

1
What is the difference between a single and double slash used in XPath?

Solved 1 Answers 2033 Views
1 1
What is the difference between a single and double slash used in XPath?
closed with the note: Got it, sir

1 Answer

1
Best answer
1

Usually absolute xpath starts with single slash. When use use absolute xpath, you will be covering whole path to the element.

Relative xpath starts with double slash. In that case you will be first finding unique parent node and path from there to the element.

 

E.g. If you want to identify logo if this page, there are two ways you can do that.

Absolute xpath = /html/body/div[2]/div[1]/div[1]/a

Relative xpath = //div[class="qa-logo"]/a

Hope that helps!

answered by (192 points)
selected by

We have resolved 1.2k+ Software Testing queries!

Software Testing Board Weekly update

We will send you handpicked questions that you would love to answer.

View previous campaigns.

Top Contributors

...