What is the best extension for XPath for Chrome? - gsumit1/TruePath GitHub Wiki

What is the best extension for XPath for Firefox?

If you are looking for an extension, which will generate multiple relative XPath instantly on a click, then definitely try Firefox or Chrome extension TruePath.

This tool also provides the option to select the normal format or page object format of XPath to support the page object model of Selenium Test Automation.

The closer look of the generated XPath

The native Dev tool of Chrome or Firefox, generate the XPath with ID attribute in case ID present for the target element or the absolute XPath in case no ID present in the target element.

If ID is generating dynamically we can’t use the XPath in our selenium automation code. Similarly, the probability of breakdown down of the absolute XPath, in the long run, is high and obviously not the best practice to follow on for constructing the XPath.

Since the TruePath generates multiple relative XPath and provides the option to select the best possible XPath for the target element that not only brings stability but also drastically reduces the effort to construct XPath.

In case, the target element is from iFrame, then it will show you the iFrame URL.

TruePath Supports:

  • Page Object XPath,
  • Relative XPath,
  • Normal XPath format,
  • XPath in iFrame,
  • XPath in Frame,
  • Indexed XPath,
  • Multiple options for the XPath,
  • Unique XPath,
  • The capability to generate the XPath using text value,
  • Easily use as Selenium locator, Selenium Page Object locator or Serenity Page Object locator.

Video Reference