How to create a XPATH

XPath is a major element in the XSLT standard, you can be used to navigate through elements and attributes in an XML document.

In the Selenium Test Case, the XPATH is an option to create commands to obtain the location of the elements, the format is the following:


You need to follow these steps:

  1. Open the tab where the element is.
  2. Use right click button with the mouse and click in inspect.
  3. Select the elements tab in the inspector and select your field.
  4. Copy the highlighted parts to create the XPATH. 

User-added image
  1. In the example, the XPATH is //input[placeholder='Select tour date']

How did we do?