How can I verify my XPath?
I am using Chrome Developers tool to inspect the elements and form my XPath. I verify it using the Chrome plugin XPath Checker, however it does not always give me the result. What is a better way to verify my XPath.
I have also tried using Firebug to inspect the bug and also using the FirePath to verify. But does Firepath also verify the XPath.
My last option would be to use the Selenium WebDriver to confirm my XPath.
This question is related to
google-chrome
firefox
selenium
xpath
selenium-webdriver
You can open the DevTools in Chrome with CTRL+I on Windows (or CMD+I Mac), and Firefox with F12, then select the Console
tab), 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.
I verify XPath and CSS selectors using WebSync Chrome extension.
It provides possibility to verify selectors and also to generate/modify selectors by clicking on element attributes.
https://chrome.google.com/webstore/detail/natu-websync/aohpgnblncapofbobbilnlfliihianac
Source: Stackoverflow.com