The two types of XPaths

Let's now understand what absolute XPaths are and how they differ from relative (customized) XPaths:

  • An absolute XPath is the entire path of the WebElement taken from the root node. For example, html/body/div/a.
  • A relative or customized XPath is one in which we use the following format. For example, if the div has an id of ABC, then the same absolute XPath will be //div[@id='ABC']/a.

There is an apparent problem with the absolute type of XPath. If the DOM structure changes in the future (for example, if div is removed), then this path will undergo changes. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.128.78.30