Xpath is used to find element’s location on web page. To find web elements HTML DOM structure is used. Xpath will be used to call element during test script execution.
Two Types of Xpath are there:-
1. Absolute Xpath – Absolute Xpath begins with single slash(/) and it means, it can be selected from root node.
2. Relative Xpath
Relative Xpath begins with double slash(//) and it means, it can be selected from anywhere on webpage.
Create Xpath Process
First to find web element location on web page and follow basic syntax of xpath to create path then to call during test script execution
Process :- Visit on page then inspect element there (We used search element).
Follow basic syntax: //tagname[@attribute=’value’] Then Create Like: //input[@id=’s’]
Note:- This is an example and there are some different ways to create Xpath, so keep learning and practicing.