Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in DevOps and Agile by (19.7k points)

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 updated both capybara and selenium-webdriver (the latter to 2.9.1) and I still get the same error. How can I fix it?

1 Answer

0 votes
by (62.9k points)

Upgrading Selenium-webdriver worked for me:

 bundle update selenium-webdriver

Browse Categories

...