如何检查元素在硒3.6作为萤火虫不是一个选项更多的FF 56? [英] how to inspect element in selenium3.6 as firebug is not an option any more for FF 56?
问题描述
selenium 3.6
。如果要找到元素,可以做些什么,检查元素就足够了? 如果我认真考虑使用较低版本的selenium,会有帮助吗?
如果您访问 的 GitHub Page
> FirePath
,它清楚地提到:
现在,如果您访问主页
$
Firebug扩展程序不再被开发或维护。我们邀请您使用FireFox.next附带的Firefox DevTools
因此,我们必须明确指出我们必须使用集成Mozilla Firefox 56.x +版本的 DevTools [F12]
。 现在,假设我们必须确定 xpath code> Search Box
WebElement on Google主页
。
- 打开
Mozilla Firefox浏览器56.x
,浏览到URLhttps://www.google.co.in
- 按
F12
打开DevTools
- 在
DevTools
在Inspector
标签上,使用Inspector
标识搜索框
WebElement。 - 复制
xpath
(绝对)并将其粘贴到文本板中。 - 在
DevTools中$ c $>构建一个逻辑唯一的
xpath
在JS
子菜单中的控制台
选项卡上,粘贴逻辑唯一xpath
你已经按照以下格式构造,并且按下Enter /
Return
:$ x(logical_unique_xpath_of_search_box)
-
由
xpath
标识的WebElement
会被反映出来。
I am trying to find a way to use firebug for FF. Unfortunately it's not supported for selenium 3.6
. What can be done if I have to locate the elements, will "Inspect" element will be sufficient?
If I get down to less version of selenium, will that help?
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
.
- Open
Mozilla Firefox 56.x
browser and browse to the urlhttps://www.google.co.in
- Press
F12
to open theDevTools
- Within the
DevTools
section, on theInspector
tab, use theInspector
to identify theSearch Box
WebElement. - Copy the
xpath
(absolute) and paste it in a text pad. - Construct a logical unique
xpath
. Within the
DevTools
section, on theConsole
tab, withinJS
sub menu, paste the logical uniquexpath
you have constructed in the following format and hitEnter
/Return
:$x("logical_unique_xpath_of_search_box")
The
WebElement
identified by thexpath
will be reflected.
这篇关于如何检查元素在硒3.6作为萤火虫不是一个选项更多的FF 56?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!