Ruby Selenium无法建立连接,因为目标计算机主动拒绝它。 - connect(2)(Errno :: ECONNREFUSED)

时间:2016-10-26 16:36:07

标签: ruby google-chrome selenium capybara

下面的完整转储:Chrome将打开然后只是坐在那里。最新版本的chrome。

  No connection could be made because the target machine actively refused it. - connect(2) (Errno::ECONNREFUSED)
  C:/Ruby193/lib/ruby/1.9.1/net/http.rb:763:in `initialize'
  C:/Ruby193/lib/ruby/1.9.1/net/http.rb:763:in `open'
  C:/Ruby193/lib/ruby/1.9.1/net/http.rb:763:in `block in connect'
  C:/Ruby193/lib/ruby/1.9.1/timeout.rb:55:in `timeout'
  C:/Ruby193/lib/ruby/1.9.1/timeout.rb:100:in `timeout'
  C:/Ruby193/lib/ruby/1.9.1/net/http.rb:763:in `connect'
  C:/Ruby193/lib/ruby/1.9.1/net/http.rb:756:in `do_start'
  C:/Ruby193/lib/ruby/1.9.1/net/http.rb:745:in `start'
  C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1285:in `request'
  ./features/step_definitions/site_search_steps.rb:17:in `/^I go to my google page that I care about$/'
  features\site_search.feature:7:in `Given I go to my google page that I care about'
  No connection could be made because the target machine actively refused it. - connect(2) (Errno::ECONNREFUSED)
  C:/Ruby193/lib/ruby/1.9.1/net/http.rb:763:in `initialize'
  C:/Ruby193/lib/ruby/1.9.1/net/http.rb:763:in `open'
  C:/Ruby193/lib/ruby/1.9.1/net/http.rb:763:in `block in connect'
  C:/Ruby193/lib/ruby/1.9.1/timeout.rb:55:in `timeout'
  C:/Ruby193/lib/ruby/1.9.1/timeout.rb:100:in `timeout'
  C:/Ruby193/lib/ruby/1.9.1/net/http.rb:763:in `connect'
  C:/Ruby193/lib/ruby/1.9.1/net/http.rb:756:in `do_start'
  C:/Ruby193/lib/ruby/1.9.1/net/http.rb:745:in `start'
  C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1285:in `request'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/rest-client-1.6.7/lib/restclient/net_http_ext.rb:51:in `request'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/http/default.rb:83:in `response_for'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/http/default.rb:39:in `request'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/http/common.rb:40:in `call'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/bridge.rb:638:in `raw_execute'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/bridge.rb:616:in `execute'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/bridge.rb:257:in `getScreenshot'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb:34:in `screenshot_as'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb:18:in `block in save_screenshot'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb:18:in `open'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb:18:in `save_screenshot'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/capybara-2.1.0/lib/capybara/selenium/driver.rb:78:in `save_screenshot'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/capybara-2.1.0/lib/capybara/session.rb:344:in `save_screenshot'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/capybara-2.1.0/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
  C:/Users/selahey/Source/Workspaces/Test Automation Code/websites_workspace/global_support/screenshot_methods.rb:19:in `take_screenshot'
  C:/Users/selahey/Source/Workspaces/Test Automation Code/websites_workspace/access_2_care_workspace/access_2_care_regression/features/support/env.rb:15:in `After'
  No connection could be made because the target machine actively refused it. - connect(2) (Errno::ECONNREFUSED)
  C:/Ruby193/lib/ruby/1.9.1/net/http.rb:763:in `initialize'
  C:/Ruby193/lib/ruby/1.9.1/net/http.rb:763:in `open'
  C:/Ruby193/lib/ruby/1.9.1/net/http.rb:763:in `block in connect'
  C:/Ruby193/lib/ruby/1.9.1/timeout.rb:55:in `timeout'
  C:/Ruby193/lib/ruby/1.9.1/timeout.rb:100:in `timeout'
  C:/Ruby193/lib/ruby/1.9.1/net/http.rb:763:in `connect'
  C:/Ruby193/lib/ruby/1.9.1/net/http.rb:756:in `do_start'
  C:/Ruby193/lib/ruby/1.9.1/net/http.rb:745:in `start'
  C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1285:in `request'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/rest-client-1.6.7/lib/restclient/net_http_ext.rb:51:in `request'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/http/default.rb:83:in `response_for'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/http/default.rb:39:in `request'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/http/common.rb:40:in `call'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/bridge.rb:638:in `raw_execute'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/bridge.rb:616:in `execute'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/bridge.rb:365:in `deleteAllCookies'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/common/options.rb:67:in `delete_all_cookies'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/capybara-2.1.0/lib/capybara/selenium/driver.rb:84:in `reset!'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/capybara-2.1.0/lib/capybara/session.rb:77:in `reset!'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/capybara-2.1.0/lib/capybara.rb:245:in `block in reset_sessions!'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/capybara-2.1.0/lib/capybara.rb:245:in `each'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/capybara-2.1.0/lib/capybara.rb:245:in `reset_sessions!'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/capybara-2.1.0/lib/capybara/cucumber.rb:10:in `After'

失败的场景: cucumber -p tags features \ site_search.feature:6#Scenario:进行应该有结果的网站搜索

1个场景(1个失败) 1步(1次失败)

0 个答案:

没有答案