与Selenium的Capybara抛出一个Net :: ReadTimeout:Net :: ReadTimeout

时间:2014-12-08 15:30:53

标签: ruby-on-rails ruby testing selenium capybara

我今天从假期回来,我的水豚和硒动力测试抛出了这个错误:

Net::ReadTimeout: Net::ReadTimeout
/Users/pupeno/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/protocol.rb:158:in `rescue in rbuf_fill'
/Users/pupeno/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/protocol.rb:152:in `rbuf_fill'
/Users/pupeno/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/protocol.rb:134:in `readuntil'
/Users/pupeno/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/protocol.rb:144:in `readline'
/Users/pupeno/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http/response.rb:39:in `read_status_line'
/Users/pupeno/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http/response.rb:28:in `read_new'
/Users/pupeno/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http.rb:1408:in `block in transport_request'
/Users/pupeno/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http.rb:1405:in `catch'
/Users/pupeno/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http.rb:1405:in `transport_request'
/Users/pupeno/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http.rb:1378:in `request'
/Users/pupeno/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http.rb:1371:in `block in request'
/Users/pupeno/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http.rb:853:in `start'
/Users/pupeno/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/http.rb:1369:in `request'
/Users/pupeno/.rvm/gems/ruby-2.1.5@watu/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/default.rb:83:in `response_for'
/Users/pupeno/.rvm/gems/ruby-2.1.5@watu/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/default.rb:39:in `request'
/Users/pupeno/.rvm/gems/ruby-2.1.5@watu/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/common.rb:40:in `call'
/Users/pupeno/.rvm/gems/ruby-2.1.5@watu/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/bridge.rb:640:in `raw_execute'
/Users/pupeno/.rvm/gems/ruby-2.1.5@watu/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/bridge.rb:618:in `execute'
/Users/pupeno/.rvm/gems/ruby-2.1.5@watu/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/bridge.rb:112:in `get'
/Users/pupeno/.rvm/gems/ruby-2.1.5@watu/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/common/navigation.rb:14:in `to'
/Users/pupeno/.rvm/gems/ruby-2.1.5@watu/gems/capybara-2.4.4/lib/capybara/selenium/driver.rb:45:in `visit'
/Users/pupeno/.rvm/gems/ruby-2.1.5@watu/gems/capybara-2.4.4/lib/capybara/session.rb:227:in `visit'
/Users/pupeno/.rvm/gems/ruby-2.1.5@watu/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'

基本上,在我离开之前没有任何改变,这些测试只适用于其他人(即其他计算机)。为了让它们再次运行,我升级了Firefox,我在/ etc / hosts中添加了一些主机名以删除DNS查找,升级所有宝石(包括capybara)。我的想法已经不多了。

环境是OS X 10.9.5。为了以防万一,我重新启动了几次。我正在运行Ruby 2.1.5,Rails 3.2.21,MiniTest 4.7.5。

还有其他想法吗?

1 个答案:

答案 0 :(得分:-3)

gem install 'eventmachine'  -v 1.0.3

如果您使用1.0.3以外的版本,请将其卸载并安装指定的版本。

可能是,这解决了这个问题。