Skip to main content

Command Palette

Search for a command to run...

How to write X-Path

Updated
1 min read
How to write X-Path
H

I am a Senior Software Engineer at BigBasket with over three years of experience in software development. Specializing in QA automation, CI/CD, and mobile automation, I am passionate about creating efficient workflows and sharing knowledge through blogs and articles.

I actively contribute to the tech community through my work, open-source projects, and insightful content. Feel free to connect with me on GitHub or LinkedIn to explore my projects and contributions.

XPath in Selenium is an XML path used for navigating through the HTML structure of the pages. XPath's expression selects nodes or list of nodes on the basis of provided attributes ex: class, id, name, link text, locator

Syntax for creating xpath

Xpath=//tagname[@attribute='value']

  • // : Select current node.
  • Tagname: Tagname of the particular node.
  • @: Select attribute.
  • Attribute: Attribute name of the node.
  • Value: Value of the attribute.

More from this blog

T

The Code Console by Himanshu Nikhare | Software Development, Automation, and Tech Insights

25 posts

A curious builder on a journey to turn ideas into code. Learning by doing, debugging through chaos, and crafting solutions one experiment at a time—because every build starts with a console.log.