"XPath for beginners" articles are authored by our guest Megha Kharbanda. These awesome tutorials will help you to understand xpath from scratch.
Part 1: About x-path and its basic syntax:
X-Path is used to navigate through web elements and attributes in an XML Document. From automation testing perspective (especially with selenium), xpath helps in identifying the web elements.
X-Paths can be created by:
- Basic Syntax
- Using AND & OR
- Contains ()
- Starts – With ()
- Text ()
The xpath of this field will be //input [@id = 'username']. Here @id will turn your focus on textbox