Xpath in selenium
Xpath is used to locate a web element based on its XML path. It stores data in a key-value pair . XPath can be used to locate HTML elements.
The fundamental behind locating elements using XPath is the traversing between various elements across the entire page and thus enabling a user to find an element with the reference of another element.
Xpath is syntax for finding any element on web page with xml expression .e location of the element in the DOM file.
The syntax of xpath is -
- // : Select current node.
- Tagname: Tagname of the particular node.
- @: Select attribute.
- Attribute: Attribute name of the node.
- Value: Value of the attribute.
XPath is nothing but the XML Path. It helps in locating any element on a web page that uses traditional XML path expression. XPath uses HTML DOM structure that looks like XML path expression.