How do I get watir-webdriver to start Firefox 4 with Firebug?

。_饼干妹妹 提交于 2019-12-04 20:53:33

问题


Any ideas? I've tried setting webdriver.firefox.useExisting=true as described in the link below hoping to reuse an existing window with firebug enabled, but no such luck.

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


回答1:


you have to create a specific profile where Firebug is always enabled, then launch firefox with this profile in your configuration




回答2:


The quick answer is:

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

But if you are running tests you probably shouldn't use the default profile.




回答3:


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


来源:https://stackoverflow.com/questions/6065092/how-do-i-get-watir-webdriver-to-start-firefox-4-with-firebug

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