如何在Selenium WebDriver(Selenium 2)中运行Firebug?

编程入门 行业动态 更新时间:2024-10-09 13:31:06
本文介绍了如何在Selenium WebDriver(Selenium 2)中运行Firebug?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

运行Selenium 2时在Firefox中激活Firebug的最佳方法是什么?

What's the best way to activate Firebug in Firefox when running Selenium 2?

编辑:好的,我知道最佳可以解释,但是配置文件 - 基于解决方案真的曾经是硒1.0的痛苦。因此,除非证明更糟,否则任何替代方案都会被认为更好;)

Ok, I realize "best" is open to interpretation, but the profile-based solution really used to be a pain with selenium 1.0. So any alternative is considered better until proved worse ;)

推荐答案

您可以在代码中创建配置文件并动态添加所需的附加组件。假设您将Firebug XPI作为firebug.xpi保存到C:\ FF_Profile文件夹中(转到 Firebug下载页面,右键单击添加到Firefox并保存为C:\ FF_Profile\firebug.xpi)。

You can create your profile in code and dynamically add required add-ons. Let's assume that you saved Firebug XPI into the C:\FF_Profile folder as firebug.xpi (go to Firebug download page, right-click on the "Add To Firefox" and save as C:\FF_Profile\firebug.xpi).

代码:

final String firebugPath = "C:\\FF_Profile\\firebug.xpi"; FirefoxProfile profile = new FirefoxProfile(); profile.addExtension(new File(firebugPath)); // Add more if needed WebDriver driver = new FirefoxDriver(profile);

这在 WebDriver常见问题解答

更多推荐

如何在Selenium WebDriver(Selenium 2)中运行Firebug?

本文发布于:2023-11-27 16:21:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1638725.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   Selenium   Firebug   WebDriver

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!