HEATH3N HEATH3N -4 years ago 118
Ruby Question

Can extensions be installed in Watir's Firefox browser?

I'm trying to use Watir on a page that has a large number of ads and it's really slowing down my tests. Why when Watir launches Firefox do my extensions (Adblock, etc.) not carry over and is it possible to install them?

Answer Source

Yes, you can do it. Let' assume you to want use Firebug extension..

First download the Firebug xpi file, then use the following code:

profile = Selenium::WebDriver::Firefox::Profile.new
profile.add_extension "../path/to/firebug.xpi"
b = Watir::Browser.new :firefox, :profile => profile
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download