环境 - 64 位 Windows 7
ruby 1.9.2- P290 ruby
gems 1.8.24
Watir 4.0.2
尝试创建浏览器(Chrome 或 IE)实例时,将失败并出现以下错误
尝试创建 Firefox 实例时,它将打开 Firefox,然后自动关闭并出现相同的错误。
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'watir-webdriver'
=> true
irb(main):003:0> ie = Watir::Browser.new:chrome
Started ChromeDriver
port=9515
version=23.0.1240.0
log=C:\Users\y93529\chromedriver.log
Selenium::WebDriver::Error::WebDriverError: unexpected response, code=502, conte
nt-type="text/html"
<HEAD><TITLE>Connection refused</TITLE></HEAD>
<BODY BGCOLOR="white" FGCOLOR="black"><H1>Connection refused</H1><HR>
<FONT FACE="Helvetica,Arial"><B>
Description: Connection refused</B></FONT>
<HR>
<!-- default "Connection refused" response (502) -->
</BODY>
from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver/remote/http/common.rb:66:in `create_response'
from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver/remote/http/default.rb:66:in `request'
from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver/remote/http/common.rb:40:in `call'
from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver/remote/bridge.rb:615:in `raw_execute'
from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver/remote/bridge.rb:92:in `create_session'
from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver/remote/bridge.rb:68:in `initialize'
from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver/chrome/bridge.rb:29:in `initialize'
from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver/common/driver.rb:37:in `new'
from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver/common/driver.rb:37:in `for'
from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver.rb:67:in `for'
from C:/ruby/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.2/lib/watir-we
bdriver/browser.rb:46:in `initialize'
from (irb):3:in `new'
from (irb):3
from C:/ruby/bin/irb:12:in `<main>'
补充一点 - 32 位 windows 7 中的相同环境,一切正常。我怀疑64位win7和32位win7对webdriver的支持是否有区别
任何建议将不胜感激。