Chrome浏览器会打开,但不会转到该页面

时间:2014-02-16 20:57:01

标签: selenium

错误是

C:\Users\kclarke\workspace\Watir>cucumber features
*** WARNING: You must use ANSICON 1.31 or higher (https://github.com/adoxa/ansicon/) to get coloured output on Windows
Starting ChromeDriver (v2.4.226107) on port 9515
[5988:6436:0216/144720:ERROR:gpu_info_collector_win.cc(146)] Could not read gaming score from assessment results.
[5988:6436:0216/144720:ERROR:chrome_views_delegate.cc(176)] NOT IMPLEMENTED
[5988:6436:0216/144720:ERROR:desktop_root_window_host_win.cc(746)] NOT IMPLEMENTED
[2636:7124:0216/144735:ERROR:ipc_channel_win.cc(405)] pipe error: 232
unknown error: Chrome failed to start: exited normally
  (Driver info: chromedriver=2.4.226107,platform=Windows NT 6.1 SP1 x86_64) (Selenium::WebDriver::Error::UnknownError)
C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.38.0/lib/selenium/webdriver/remote/response.rb:51:in `assert_ok'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.38.0/lib/selenium/webdriver/remote/response.rb:15:in `initialize'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.38.0/lib/selenium/webdriver/remote/http/common.rb:59:in `new'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.38.0/lib/selenium/webdriver/remote/http/common.rb:59:in `create_response'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.38.0/lib/selenium/webdriver/remote/http/default.rb:66:in `request'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.38.0/lib/selenium/webdriver/remote/http/common.rb:40:in `call'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.38.0/lib/selenium/webdriver/remote/bridge.rb:634:in `raw_execute'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.38.0/lib/selenium/webdriver/remote/bridge.rb:99:in `create_session'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.38.0/lib/selenium/webdriver/remote/bridge.rb:68:in `initialize'

Chrome驱动程序(版本号v2.4.226107)安装在路径:C:\Ruby200\bin;C:\Users\kclarke\workspace\bin

我的代码如下:

require 'rubygems'
require 'watir-webdriver'

#@browser = Watir::Browser.new :firefox
@browser = Watir::Browser.new :chrome
#@browser = Watir::Browser.new :ie
@browser.goto 'http:XXXXXXXXXXXXXXXXX'

1 个答案:

答案 0 :(得分:1)

首先,这与错误的PATH无关,正如您可以从消息中看到的那样,ChromeDriver可以成功启动。

然后我会建议您先升级ChromeDriver,然后再做其他事情,因为您的版本已经过时了。从更改日志here开始,版本2.4为5个月,最新版本为2.9,支持Chrome 31-34。 (版本2.4声称支持Chrome 32,但您的Chrome 32.0.1700.107 m现在是最新版本,而不是ChromeDriver 2.4发布时的版本。)