Identification using XPath is another locator identification strategy supported by selenium. XPath is query language used for locating nodes within an XML document. Since HTML can be considered to be an implementation of XML, XPath can be used for locating the web elements present within the HTML of the web application. Like CSS, XPath can also locate almost any element within a web application (even those without class, name or id attribute).
I shall demonstrate some of the common XPath locator identification methods through an example. For this take up the Wikipedia-login page. We shall try to describe the user name field on the page using the common XPath identification methods.