Hire QA – Specialized in QA Recruitment, Technical Interviews and Testing Solutions

What is Relative and Absolute Xpath?

Category: Selenium WebDriver

Absolute Xpath: It uses Complete path from the Root Element to the desire element.
Example: /HTML/body/div/div[@id=’Email’]

Relative Xpath: You can simply start by referencing the element you want and go from there. Always Relative Xpaths are preferred as they are not the complete paths from the Root element. … So Always use Relative Xpaths in your Automation.
Example: //span[@class=’Email’]

Leave a Reply

Your email address will not be published. Required fields are marked *