Watir Webdriver ECONNRESET错误

时间:2012-07-12 19:25:39

标签: ruby webdriver watir watir-webdriver

我收到此错误

C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:141:in `read_nonblock': An existing connection was forcibly closed by the remote host. (Errno::ECONNRESET)
    from C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:141:in `rbuf_fill'
    from C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:122:in `readuntil'
    from C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:132:in `readline'
    from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:2562:in `read_status_line'
    from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:2551:in `read_new'
    from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1319:in `block in transport_request'
    from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1316:in `catch'
    from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1316:in `transport_request'
    from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1293:in `request'
    from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1064:in `head'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.24.0/lib/selenium/webdriver/chrome/service.rb:63:in `block in stop'
    from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:745:in `start'
    from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:557:in `start'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.24.0/lib/selenium/webdriver/chrome/service.rb:59:in `stop'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.24.0/lib/selenium/webdriver/chrome/bridge.rb:50:in `quit'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.24.0/lib/selenium/webdriver/common/driver.rb:166:in `quit'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.1/lib/watir-webdriver/browser.rb:87:in `close'
    from test_google.rb:9:in `block in <main>'
    from test_google.rb:5:in `times'
    from test_google.rb:5:in `<main>'

每当我连续进行测试时。我相信这是一个webdriver / selenium bug,但是如果有人可以帮我修复或确定原因,我想。

以下是您可以尝试在irb中运行的一些代码:

20.times { b = Watir::Browser.new :chrome; b.goto "http://google.com"; p b.div.exists?; b.close;}

编辑:我更新了我的ChromeDriver,但没有收到上述代码的错误。

1 个答案:

答案 0 :(得分:0)

要解决此问题,请尝试更新您的Chrome驱动程序:http://code.google.com/p/chromedriver/downloads/list