When Firefox was updated on my laptop a few days ago to version 19, suddenly my Cucumber tests using Selenium and Firefox stopped working, with error:
unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055) (Selenium::WebDriver::Error::WebDriverError)
When I investigated, I found that Capybara / Selenium didn’t support this version yet.
The first thing I did was to downgrade Firefox to a previous version… But I don’t like this idea. In my opinion, the test suite should never depend on the same browser which is used by the user, it feels fragile and may break anytime again, when Firefox is upgraded.
So, the solution is relatively simple:
1) Download a previous Firefox version (I choosed the version 17, 64bits) here:
2) Extract the archive, you should get a “firefox” folder containing the program and its binaries
3) Move the entire folder to your desired location.
For example, on Ubuntu:
4) Now, in your env.rb file, add this:
1 2 3 4 5
I did a slightly improved version, so I can define the path to the binary as an environment variable. If the environment variable is not present, then it simply falls back to the system’s default Firefox:
1 2 3 4 5
But don’t forget to add this line to your .bashrc file for the above to work as expected:
Thanks for reading.
Happy testing !