In Firefox xpath not showing detail (relative) xpath for any element

2.4k Views Asked by At

Firefox not showing relative xpath for any element. I am using Firefox version 56.0(32 bit)

2

There are 2 best solutions below

1
Zakaria Shahed On BEST ANSWER

There has a problem with the latest version of Firefox(56.0).You need to downgrade your firefox for the version to solve this.Alternatively, you can use chrome to verify XPath

You can copy xpath: enter image description here You can open a Console in Chrome, and check the XPath by typing $x("your_xpath_here"). This will return an array of matched values. If it is empty, you know there is no match on the page.

For example: enter image description here

0
Sebastian Zartner On

The Firefox DevTools copy the absolute XPath when you right-click an element within the Inspector and choose Copy > XPath from the context menu.

That's the same what Firebug did. Only FirePath (a Firebug extension for creating XPaths and CSS selectors) and the Chrome DevTools create a relative path to the selected element.

I have now filed bug 1410810 asking to adjust the Firefox DevTools to also create a relative XPath.