Tell me more ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I am running selenium tests with firefox and chrome drivers. I get a connection refused error when I run the tests in as a block

Test example :

require 'minitest_helper'

headless = Headless.new
headless.start
browser = Selenium::WebDriver.for :chrome

describe "Test Example" do

  after :all do
    headless.destroy
  end
  it "test" do
    browser.navigate.to "http://google.com"
  end
end 

stack trace:

1) Error:
Example test#test_0001_test:
Errno::ECONNREFUSED: Connection refused - connect(2)
    /usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/http.rb:762:in `initialize'
    /usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/http.rb:762:in `open'
    /usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/http.rb:762:in `block in connect'
    /usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
    /usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
    /usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/http.rb:762:in `connect'
    /usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
    /usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/http.rb:744:in `start'
    /usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/http.rb:1284:in `request'
    /usr/local/rvm/gems/ruby-1.9.3-p125@cam_integration/gems/selenium-webdriver-2.31.0/lib/selenium/webdriver/remote/http/default.rb:83:in `response_for'
    /usr/local/rvm/gems/ruby-1.9.3-p125@cam_integration/gems/selenium-webdriver-2.31.0/lib/selenium/webdriver/remote/http/default.rb:39:in `request'
    /usr/local/rvm/gems/ruby-1.9.3-p125@cam_integration/gems/selenium-webdriver-2.31.0/lib/selenium/webdriver/remote/http/common.rb:40:in `call'
    /usr/local/rvm/gems/ruby-1.9.3-p125@cam_integration/gems/selenium-webdriver-2.31.0/lib/selenium/webdriver/remote/bridge.rb:616:in `raw_execute'
    /usr/local/rvm/gems/ruby-1.9.3-p125@cam_integration/gems/selenium-webdriver-2.31.0/lib/selenium/webdriver/remote/bridge.rb:594:in `execute'
    /usr/local/rvm/gems/ruby-1.9.3-p125@cam_integration/gems/selenium-webdriver-2.31.0/lib/selenium/webdriver/remote/bridge.rb:100:in `get'
    /usr/local/rvm/gems/ruby-1.9.3-p125@cam_integration/gems/selenium-webdriver-2.31.0/lib/selenium/webdriver/common/navigation.rb:14:in `to'
    test/integration/signup_test.rb:13:in `block (2 levels) in <main>'

1 tests, 0 assertions, 0 failures, 1 errors, 0 skips
share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.