Basics of XPath
Learn the basics of XPath and strengthen your concepts by playing around with a simple example.
We'll cover the following...
What is XPath?
XPath is a query language for selecting nodes from an XML document. In Selenium for UI test automation, we use XPath to locate a WebElement in the DOM (Document Object Model) to interact with and perform any operation on the page.
XPath syntax
Basic components of a WebElement:
- HTML Tag
- Attributes
General XPath syntax to identify a WebElement in the HTML Document:
//tagname[@attribute=’Value‘]
Example
Let’s take a look at the ...