如何让watir-webdriver启动带有Firebug的Firefox 4?

7

好问题,我也在想你是怎么做到的。 - Alastair Montgomery
3个回答

6

您需要创建一个特定的配置文件,其中Firebug始终处于启用状态,然后在您的配置中使用此配置文件启动Firefox


5
快速回答是:
browser = Watir::Browser.new(:firefox, :profile => "default")

但是,如果你正在运行测试,你可能不应该使用默认配置文件。


3
更详细的答案请参考WebDriver Ruby绑定的维基页面:http://code.google.com/p/selenium/wiki/RubyBindings#Adding_an_extension - jarib

1
profile = Selenium::WebDriver::Firefox::Profile.new
profile.add_extension "/path/to/firebug.xpi"
browser = Watir::Browser.new :firefox, :profile => profile

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接