7

有任何想法吗?我已经尝试按照下面链接中的描述设置 webdriver.firefox.useExisting=true,希望重用启用了 firebug 的现有窗口,但没有这样的运气。

http://code.google.com/p/selenium/wiki/FirefoxDriver

4

3 回答 3

6

您必须创建一个始终启用 Firebug 的特定配置文件,然后在您的配置中使用此配置文件启动 firefox

于 2011-05-19T21:44:51.983 回答
5

快速的答案是:

browser = Watir::Browser.new(:firefox, :profile => "default")

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

于 2011-05-19T22:52:26.423 回答
1
profile = Selenium::WebDriver::Firefox::Profile.new
profile.add_extension "/path/to/firebug.xpi"
browser = Watir::Browser.new :firefox, :profile => profile
于 2014-10-02T14:31:22.550 回答