Watir - 无法建立连接,因为目标计算机主动拒绝它。 - connect(2)表示“127.0.0.1”端口9518

时间:2016-10-31 17:04:46

标签: ruby watir

我是红宝石和watir的新手。我正在尝试运行以下行:

require 'watir-webdriver'
b = Watir::Browser.new :chrome
b.goto 'https://www.google.co.in/'

Chrome已打开,但浏览器未获取谷歌页面。我收到以下错误:

Errno::ECONNREFUSED: No connection could be made because the target machine actively refused it. - connect(2) for "127.0.0.1" port 9518
    from C:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:879:in `initialize'
    from C:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:879:in `open'
    from C:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:879:in `block in connect'
    from C:/Ruby22-x64/lib/ruby/2.2.0/timeout.rb:73:in `timeout'
    from C:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:878:in `connect'
    from C:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:863:in `do_start'
    from C:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:852:in `start'
    from C:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:1375:in `request'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-3.0.0/lib/selenium/webdriver/remote/http/default.rb:103:in `response_for'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-3.0.0/lib/selenium/webdriver/remote/http/default.rb:57:in `request'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-3.0.0/lib/selenium/webdriver/remote/http/common.rb:59:in `call'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-3.0.0/lib/selenium/webdriver/remote/bridge.rb:653:in `raw_execute'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-3.0.0/lib/selenium/webdriver/remote/bridge.rb:631:in `execute'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-3.0.0/lib/selenium/webdriver/remote/bridge.rb:136:in `get'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-3.0.0/lib/selenium/webdriver/common/navigation.rb:32:in `to'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/watir-webdriver-0.9.3/lib/watir-webdriver/browser.rb:77:in `goto'
    from (irb):17
    from C:/Ruby22-x64/bin/irb:11:in `<main>'

我寻找其他主题和Q&amp; A但我没有找到明智的答案。

0 个答案:

没有答案