Google News
logo
JUnit - Interview Questions
What is the difference between Absolute and Relative Path?
Absolute XPath : It is the direct way to find the element, but the disadvantage of the absolute XPath is that, if there are any changes made in the path of the element then that XPath gets failed. For example : /html/body/div[1]/section/div[1]/div
 
Relative XPath : For Relative XPath, the path starts from the middle of the HTML DOM structure. It begins with the double forward slash (//), which means it can search the element anywhere at the webpage. For example : //input[@id=‘ap_email’]

Advertisement