24

Since Web Developer Plugin is an self-sufficient tool, ideally it should contain XPath checker/validator as FireBug did.

Actually I could not find it. I am not sure that it exists. But if it is, please anybody help to navigate to.

Thanks!

1
  • 1
    Just to be clear for the latest version of Firefox and Chrome you don't need a plugin. You can use the console and $x per comment below to validate your xpath. Commented May 4, 2018 at 6:47

3 Answers 3

41

In Firefox you can use the web developer tools console for xpath validation like this:

1.Open Web Developer tools.

2.Click on Console

3.Type $x("path")

This should let you validate that your path is valid.

References:

https://developer.mozilla.org/en-US/docs/Tools/Web_Console/The_command_line_interpreter

https://developer.mozilla.org/en-US/docs/Web/XPath

Sign up to request clarification or add additional context in comments.

Comments

5

Now it is possible to use xpath directly from the browser.

  1. Open Web Developer tools by pressing F12
  2. In the inspector there is a search bar at the top called Search HTML
  3. Enter your xpath there and type ENTER

Now the inspector should be pointing to the element that was the outcome of evaluating the xpath. For example after evaluating //div[@id="notify-container"] the inspector is pointing to that div

Comments

0

I am using AutoPager extension on Firefox. It is quite handy for generate xpath and search xpath. you can refer to this post for more information: https://thachhoangautomation.wordpress.com/2017/10/11/generatesearch-cssselector-and-xpath-on-firefox-55-onward/

1 Comment

The blog post link is dead. In general, it's good to copy the essential information from a post into your Stack Overflow answer, instead of just linking to another article.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.