SideQuirk Blogs

SideQuirk Blogs

How to write X-Path

How to write X-Path

Side Quirk's photo
Side Quirk
·Jul 3, 2022·

1 min read

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.
 
Share this