使用最新的selenium-webdriver,“无法在60秒内获得稳定的Firefox连接”。

20

我正在尝试使用Capybara和shoulda来测试一个启用了JavaScript的Rails页面。我的环境是Ubuntu 11.10(和FireFox 7),运行在Windows 7作为主机的VirtualBox中,我已经在gems中安装了therubyracer。

我的测试代码看起来像这样:

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

(其中带有文本“Hi”的链接具有一个简单的jQuery click()函数,可以将“Hello”写入另一个

; 它是实时工作的) 但测试报告如下:

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'

我发现了这个问题,但是我已经运行了bundle update命令来更新capybara和selenium-webdriver(后者更新到了2.9.1),但是我仍然遇到相同的错误。请问我应该怎么解决?


这对我刚刚起作用了。无论是因为我运气好,超时没有发生,还是因为我已经在运行FF,我不知道。 - Chowlett
在我切换到FF 9.0之后,它对我起作用了。 - Siddhartha Mukherjee
1个回答

31

升级selenium-webdriver对我有用:

bundle update selenium-webdriver

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接