What is the difference between / and // in XPath?
Watch the answer for this Selenium Interview Question in a detailed manner in the below youtube video:
Note: Don’t forget to subscribe to my Youtube channel here: Click here
Notes used for explanation in this Youtube video are provided after the video:
Notes used in the above Youtube Video:
The following are the differences between ‘/’ and ‘//’ in XPath Expressions:
- > First Difference
- – If the XPath Expression which you have created for locating the element is starting with ‘/’ is known as Absolute XPath
- – If the XPath Expression which you have created for locating the element is starting with ‘//’ is known as Relative XPath
- > Second Difference
- – ‘/’ in an XPath Expression searches for the immediate child node while locating the web elements on the page
- – ‘//’ in an XPath Expression searches for the immediate and next level child nodes while locating the web elements on the page
- > For more Selenium Interview Questions and answers, continue to the next post (Click on Next Post link below)
- > Check complete Selenium Interview Questions list here (Click here)
Please leave your questions/comments/feedback below.
Happy Learning ?