I'm trying to test a javascript-enabled Rails page using Capybara and shoulda. My setup is Ubuntu 11.10 (and FireFox 7) running on VirtualBox with Windows 7 as host. I have therubyracer in my gems.
My test code looks like this:
context "with javascript" do
setup do
Capybara.current_driver = :selenium
end
should "handle javascript" do
visit '/'
click_link 'Hi'
assert page.has_content? "Hello"
end
end
(where the link with text "Hi" has a simple jQuery click() function to write "Hello" into another div; it works live) but the test reports:
unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055)
Exception `Selenium::WebDriver::Error::WebDriverError' at /usr/local/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.9.1/lib/selenium/webdriver/firefox/launcher.rb:77:in `connect_until_stable'
I found this question, but I've now bundle update
d both capybara and selenium-webdriver (the latter to 2.9.1) and I still get the same error. How can I fix it?
Upgrading selenium-webdriver worked for me:
bundle update selenium-webdriver
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With