How to Get Firebug, Capybara and Selenium Working Together
Posted in Inside TFG
I had an issue whereby a label I thought was fine wasn’t being picked up on my Cucumber tests. It turned out that the test environment was of course running our compiled javascript and I hadn’t compiled it since my change. The labels didn’t have the ‘for’ attribute specified so Selenium was whinging it couldn’t find the element I wanted to find.
In any case I couldn’t find an explanation of how to get Firebug working with Selenium and Capybara but after some doc reading I got my solution working so I thought I’d post it here.
In my env.rb file I have :
Capybara.register_driver :selenium do |app|
Capybara::Driver::Selenium
profile = Selenium::WebDriver::Firefox::Profile.new
profile.add_extension(File.expand_path("features/support/firebug.xpi"))
Capybara::Driver::Selenium.new(app, { :browser => :firefox, :profile => profile })
end