SocketError: getaddrinfo: Name or service not known --> error while running test case

Hi all,

I am getting the below error when I try to run my test case. I have
already started selenium RC server (port:4444)… Also I have specified
" 127.0.0.1 localhost " in /etc/hosts …

:ruby test1.rb
Loaded suite test1
Started
E
Finished in 0.022698 seconds.

  1. Error:
    testfestool(Test1):
    SocketError: getaddrinfo: Name or service not known
    /usr/lib/ruby/1.8/net/http.rb:560:in initialize' /usr/lib/ruby/1.8/net/http.rb:560:inopen’
    /usr/lib/ruby/1.8/net/http.rb:560:in connect' /usr/lib/ruby/1.8/timeout.rb:56:intimeout’
    /usr/lib/ruby/1.8/timeout.rb:76:in timeout' /usr/lib/ruby/1.8/net/http.rb:560:inconnect’
    /usr/lib/ruby/1.8/net/http.rb:553:in do_start' /usr/lib/ruby/1.8/net/http.rb:542:instart’
    /usr/lib/ruby/1.8/net/http.rb:1035:in request' /usr/lib/ruby/1.8/net/http.rb:845:inpost’
    /home/arawat/.gem/ruby/1.8/gems/selenium-client-1.2.18/lib/
    selenium/client/protocol.rb:89:in http_post' /home/arawat/.gem/ruby/1.8/gems/selenium-client-1.2.18/lib/ selenium/client/protocol.rb:12:inremote_control_command’
    /usr/lib/ruby/1.8/timeout.rb:56:in timeout' /usr/lib/ruby/1.8/timeout.rb:76:intimeout’
    /home/arawat/.gem/ruby/1.8/gems/selenium-client-1.2.18/lib/
    selenium/client/protocol.rb:11:in remote_control_command' /home/arawat/.gem/ruby/1.8/gems/selenium-client-1.2.18/lib/ selenium/client/protocol.rb:19:instring_command’
    /home/arawat/.gem/ruby/1.8/gems/selenium-client-1.2.18/lib/
    selenium/client/base.rb:85:in start_new_browser_session' /home/arawat/.gem/ruby/1.8/gems/selenium-client-1.2.18/lib/ selenium/client/base.rb:99:instart’
    test1.rb:27:in `setup’

The code am using for connection is:

require “rubygems”
require “selenium/client”
require “test/unit”

class Test1 < Test::Unit::TestCase
def setup
@verification_errors = []

 @selenium = Selenium::Client::Driver.new \
    :host => "http://127.0.0.1",
    :port => 4444,
    :browser => "*firefox",
    :url => "http://www.google.com/",
    :timeout_in_second =>60

 #start browser session
 @selenium.start
 @selenium.set_context("test1")

end

def teardown
@selenium.stop
assert_equal [], @verification_errors
end

Let me know if you need any other additional information. Thanks for
your help in advance :slight_smile:

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs