public
Created

  • Download Gist
gistfile1.rb
Ruby
1 2 3 4
profile = Selenium::WebDriver::Firefox::Profile.new
profile.add_extension("/path/to/firebug.xpi")
 
driver = Selenium::WebDriver.for :firefox, :profile => profile

Adding your comment from the Pivotal Blog here as reference material:

There's two ways to do what you want using WebDriver APIs:

  1. Use Profile#add_extension. This lets you programatically add an .xpi to the profile used by WebDriver. Here's an example:
    http://gist.github.com/590509

  2. Use the same approach as above, but tell WebDriver explicitly that it should use the named profile as a template, i.e. if the profile was named "capybara":

Selenium::WebDriver.for :firefox, :profile => "capybara"

Hooking this into Capybara should be simple using the new API to configure drivers:

http://github.com/jnicklas/capybara/commit/d536eea864a6ed7e9e0032ec9d61edaadba6a375

@eirc: That post has an "ignore this post" update at the top. The info about patching the XPI is pretty bad, since the same thing can be done by simply setting a preference:

profile['extensions.firebug.currentVersion'] = "9.99"

Warning blindness has surely set in...!

Sorry for the miss-information and thanks for the info.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.