Topic: https://intoli.com/blog/running-selenium-with-headless-chrome-in-ruby/
hide preview

What's next? verify your email address for reply notifications!

unverified 6y, 167d ago [edited]

Hi,

So I followed your steps but I still get this error when trying to run the test:

/usr/share/ruby/net/protocol.rb:158:in `rescue in rbuf_fill': Net::ReadTimeout (Net::ReadTimeout)
        from /usr/share/ruby/net/protocol.rb:152:in `rbuf_fill'
        from /usr/share/ruby/net/protocol.rb:134:in `readuntil'
        from /usr/share/ruby/net/protocol.rb:144:in `readline'
        from /usr/share/ruby/net/http/response.rb:39:in `read_status_line'
        from /usr/share/ruby/net/http/response.rb:28:in `read_new'
        from /usr/share/ruby/net/http.rb:1412:in `block in transport_request'
        from /usr/share/ruby/net/http.rb:1409:in `catch'
        from /usr/share/ruby/net/http.rb:1409:in `transport_request'
        from /usr/share/ruby/net/http.rb:1382:in `request'
        from /usr/share/ruby/net/http.rb:1375:in `block in request'
        from /usr/share/ruby/net/http.rb:852:in `start'
        from /usr/share/ruby/net/http.rb:1373:in `request'
        from /usr/local/share/gems/gems/selenium-webdriver-3.11.0/lib/selenium/webdriver/remote/http/default.rb:121:in `response_for'
        from /usr/local/share/gems/gems/selenium-webdriver-3.11.0/lib/selenium/webdriver/remote/http/default.rb:76:in `request'
        from /usr/local/share/gems/gems/selenium-webdriver-3.11.0/lib/selenium/webdriver/remote/http/common.rb:59:in `call'
        from /usr/local/share/gems/gems/selenium-webdriver-3.11.0/lib/selenium/webdriver/remote/bridge.rb:164:in `execute'
        from /usr/local/share/gems/gems/selenium-webdriver-3.11.0/lib/selenium/webdriver/remote/bridge.rb:97:in `create_session'
        from /usr/local/share/gems/gems/selenium-webdriver-3.11.0/lib/selenium/webdriver/remote/bridge.rb:53:in `handshake'
        from /usr/local/share/gems/gems/selenium-webdriver-3.11.0/lib/selenium/webdriver/chrome/driver.rb:47:in `initialize'
        from /usr/local/share/gems/gems/selenium-webdriver-3.11.0/lib/selenium/webdriver/common/driver.rb:44:in `new'
        from /usr/local/share/gems/gems/selenium-webdriver-3.11.0/lib/selenium/webdriver/common/driver.rb:44:in `for'
        from /usr/local/share/gems/gems/selenium-webdriver-3.11.0/lib/selenium/webdriver.rb:85:in `for'
        from login-test.rb:6:in `<main>'

ChromeDriver:

chromedriver
Starting ChromeDriver 2.38.551591 (bcc4a2cdef0f6b942b2bb8049068f65340fa2a69) on port 9515
Only local connections are allowed.

GoogleChrome:

google-chrome-stable --version
Google Chrome 66.0.3359.117

Ruby:

ruby --version
ruby 2.0.0p648 (2015-12-16) [x86_64-linux]

SeleniumWebDriver

gem install selenium-webdriver
Successfully installed selenium-webdriver-3.11.0

Also, my test-case header looks like this:

require "selenium-webdriver"

options = Selenium::WebDriver::Chrome::Options.new
options.add_argument('--headless')
driver = Selenium::WebDriver.for :chrome, options: options

Also tried extra switches in here for disable-gpu, no-sandbox with no successful results. PS: tested the connectivity towards the desired page to test with 'curl' and it was just fine

Appreciate any kind of input & help!

Thank you,

Kindest regards,

Andrei

hide preview

What's next? verify your email address for reply notifications!