ysbaddaden / selenium-webdriver-crystal

Selenium Webdriver client for the Crystal programming language
Other
57 stars 16 forks source link

Unhandled exception: connect: Cannot assign requested address (Errno) #35

Open prutheus opened 5 years ago

prutheus commented 5 years ago

I get following error:

Unhandled exception: connect: Cannot assign requested address (Errno)
  from /usr/share/crystal/src/socket/tcp_socket.cr:73:15 in 'initialize'
  from /usr/share/crystal/src/socket/tcp_socket.cr:27:3 in 'new'
  from /usr/share/crystal/src/http/client.cr:676:5 in 'socket'
  from /usr/share/crystal/src/http/client.cr:572:5 in 'send_request'
  from /usr/share/crystal/src/http/client.cr:511:5 in 'exec_internal_single'
  from /usr/share/crystal/src/http/client.cr:498:5 in 'exec_internal'
  from /usr/share/crystal/src/http/client.cr:494:5 in 'exec'
  from /usr/share/crystal/src/http/client.cr:612:5 in 'exec'
  from /usr/share/crystal/src/http/client.cr:342:3 in 'post'
  from lib/selenium/src/webdriver.cr:50:9 in 'post'
  from lib/selenium/src/webdriver/session.cr:30:18 in 'initialize'
  from lib/selenium/src/webdriver/session.cr:25:5 in 'initialize'
  from lib/selenium/src/webdriver/session.cr:25:5 in 'new'
  from test.cr:13:7 in '__crystal_main'
  from /usr/share/crystal/src/crystal/main.cr:97:5 in 'main_user_code'
  from /usr/share/crystal/src/crystal/main.cr:86:7 in 'main'
  from /usr/share/crystal/src/crystal/main.cr:106:3 in 'main'
  from __libc_start_main
  from _start
  from ???

with this code:

require "selenium/webdriver"

      capabilities = {
        browserName: "chrome",
        platform: "ANY",
        chromeOptions: {args: ["--disable-gpu", "--headless", "--no-sandbox", "--user-agent=Mozilla/5.0 (Macintosh;Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36"]}
      }

      driver = Selenium::Webdriver.new
      session = Selenium::Session.new(driver, capabilities)

session.stop

Any ideas what went wrong?

ysbaddaden commented 5 years ago

Sounds like a problem on your network?