【问题标题】:Watir Chrome Driver "EOFError: end of file reached" ErrorWatir Chrome 驱动程序“EOFError:到达文件末尾”错误
【发布时间】:2013-05-31 19:32:29
【问题描述】:

我在跑步:

Chrome 版本 google-chrome-stable/unknown uptodate 27.0.1453.93-r200836

Debian GNU/Linux 6.0.6(挤压)32x

当我尝试运行时:

require 'watir-webdriver'
require 'headless'
headless = Headless.new
headless.start
b = Watir::Browser.new(:chrome)

我明白了:

EOFError: end of file reached
        from /usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/protocol.rb:141:in `read_nonblock'
        from /usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/protocol.rb:141:in `rbuf_fill'
        from /usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/protocol.rb:122:in `readuntil'
        from /usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/protocol.rb:132:in `readline'
        from /usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/http.rb:2563:in `read_status_line'
        from /usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/http.rb:2552:in `read_new'
        from /usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/http.rb:1320:in `block in transport_request'
        from /usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/http.rb:1317:in `catch'
        from /usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/http.rb:1317:in `transport_request'
        from /usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/http.rb:1294:in `request'
        from /usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/http.rb:1287:in `block in request'
        from /usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/http.rb:746:in `start'
        from /usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/http.rb:1285:in `request'
        from /usr/local/rvm/gems/ruby-1.9.3-p429/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/http/default.rb:83:in `response_for'
        from /usr/local/rvm/gems/ruby-1.9.3-p429/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/http/default.rb:39:in `request'
        from /usr/local/rvm/gems/ruby-1.9.3-p429/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/http/common.rb:40:in `call'
        from /usr/local/rvm/gems/ruby-1.9.3-p429/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/bridge.rb:629:in `raw_execute'
        from /usr/local/rvm/gems/ruby-1.9.3-p429/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/bridge.rb:98:in `create_session'
        from /usr/local/rvm/gems/ruby-1.9.3-p429/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/bridge.rb:68:in `initialize'
        from /usr/local/rvm/gems/ruby-1.9.3-p429/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/chrome/bridge.rb:29:in `initialize'
        from /usr/local/rvm/gems/ruby-1.9.3-p429/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/common/driver.rb:37:in `new'
        from /usr/local/rvm/gems/ruby-1.9.3-p429/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/common/driver.rb:37:in `for'
        from /usr/local/rvm/gems/ruby-1.9.3-p429/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver.rb:67:in `for'
        from /usr/local/rvm/gems/ruby-1.9.3-p429/gems/watir-webdriver-0.6.4/lib/watir-webdriver/browser.rb:46:in `initialize'
        from (irb):7:in `new'
        from (irb):7
        from /usr/local/rvm/rubies/ruby-1.9.3-p429/bin/irb:16:in `<main>'

我真的不知道如何开始解决这个问题。我正在搜索谷歌,但到目前为止没有找到任何适合我的修复程序。希望有人可以帮助解决这个问题。

【问题讨论】:

  • 您可以先分享您的操作系统和版本。
  • Chrome 版本 google-chrome-stable/unknown uptodate 27.0.1453.93-r200836, Debian GNU/Linux 6.0.6 (squeeze) 32x
  • newUserNameHere:你的 PATH 中有 chromedriver 吗?
  • 刚刚检查过,我确定。它也可以正常启动:root@servername:~# chromedriver Started ChromeDriver port=9515 version=26.0.1383.0 log=/root/chromedriver.log
  • 当我使用 selenium 启动无头 chrome 时,我也会得到同样的结果。所以我知道它不是特定于watir的。在出现错误消息之前,它似乎正在处理最后一个命令大约 20 秒左右,而如果我只是启动 chromedriver,它几乎是即时的。

标签: selenium debian watir selenium-chromedriver


【解决方案1】:

所以几个月后我又回到了这个话题。当我在此处下载最新的 chromedriver 时,似乎最初导致此问题的任何原因都已修复:

http://chromedriver.storage.googleapis.com/index.html

目前是 2.9 版

【讨论】:

  • 如果您的系统上有多个 chromedriver 文件,那么“which chromedriver”和“chromedriver --version”可能指向与 Selenium 所见不同的 chromedriver。执行 find 命令找到所有名为“chromedriver”的文件并删除它们,然后再将上面链接中的最新版本放在 /usr/local/bin 中,它应该可以工作
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-07-11
  • 2017-02-28
  • 1970-01-01
  • 1970-01-01
  • 2017-12-29
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多