Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

  • Blog Navigation
Using Firebug with WebDriver in Capybara/Cucumber

Ever wanted to be able to debug an HTML page using the power of Firebug while running Cucumber/Capybara features/steps?

Follow these simple steps and you can get it to work:

1) Create a new “WebDriver” Firefox profile using the instructions found here

2) Fire up Firefox using the newly created profile and install/configure Firebug the way you want it. See instructions above.

3) Run your Cucumber/Capybara steps and pause the feature using a sleep() statement long enough for you to poke around in the page with Firebug.

**Note this has been proven to work on OS X, your mileage on other OS’s may be limited.

  • Better than a `sleep`, a `debugger` so you don’t have to guess at a long sleep time, and you get to play around with the system if you need to.

  • Jari Bakken


    This method relies on an implementation detail in WebDriver (the fact that the anonymous profile created is named “WebDriver”) which might change in the future.

    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:

    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:

Share This