FirePath not displaying HTML code after typing x-path

99封情书 提交于 2020-01-24 23:19:13

问题


Upon typing xpath in fire-path text field, if x-path is correct then it'll display the corresponding HTML code. It was working fine previously.

But now it's not displaying the corresponding HTML code even though the xpath is correct.

Can anyone help me to find the solution for this problem? I even uninstalled fire-path and installed again but still, it's not working.


回答1:


If you visit the GitHub Page of FirePath, it clearly mentions that :

FirePath is a Firebug extension that adds a development tool to edit, inspect and generate XPath expressions and CSS3 Selectors

Now if you visit the Home Page of FireBug, it clearly mentions that :

The Firebug extension isn't being developed or maintained any longer. We invite you to use the Firefox DevTools instead, which ship with Firebug.next

So the direction is clear that We have to use DevTools [F12] which comes integrated with the Mozilla Firefox 56.x + releases onwards.

Example Usage :

Now, let us assume we have to identify the xpath of the Search Box WebElement on Google Home Page.

  1. Open Mozilla Firefox 56.x browser and browse to the url https://www.google.co.in
  2. Press F12 to open the DevTools
  3. Within the DevTools section, on the Inspector tab, use the Inspector to identify the Search Box WebElement.
  4. Copy the xpath (absolute) and paste it in a text pad.
  5. Construct a logical unique xpath.
  6. Within the DevTools section, on the Console tab, within JS sub menu, paste the logical unique xpath you have constructed in the following format and hit Enter/Return:

    $x("logical_unique_xpath_of_search_box")
    
  7. The WebElement identified by the xpath will be reflected.




回答2:


The new version of Firefox is not supporting firebug.

You can use chrome dev tools if you like so.

I personally writing XPath using chrome dev tools

For more info refer my answer here

Is there a way to get the xpath in google chrome?



来源:https://stackoverflow.com/questions/46600775/firepath-not-displaying-html-code-after-typing-x-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!