I'm trying to simplify my Selenium tests by running headless alongside my test suite on Docker. I'm running a Debian Jessie image with google-chrome-stable installed from PPA and chromedriver 2.33 installed. I've also attached /dev/shm to maximize my memory in the container. I've verified chromedriver runs fine inside of the container. However, when I run a simple test I get a timeout:
browser = Watir::Browser.new :chrome, headless: true
browser.goto 'google.com'
browser.text_field(title: 'Search').set 'Hello World!'
browser.button(type: 'submit').click
puts browser.title
browser.quit
/usr/local/lib/ruby/2.4.0/net/protocol.rb:176:in `rbuf_fill': Net::ReadTimeout (Net::ReadTimeout)
from /usr/local/lib/ruby/2.4.0/net/protocol.rb:154:in `readuntil'
from /usr/local/lib/ruby/2.4.0/net/protocol.rb:164:in `readline'
from /usr/local/lib/ruby/2.4.0/net/http/response.rb:40:in
......
One thing to mention is that chromedriver is installed at /chromedriver/chromedriver and then added to $PATH. Does Watir/Selenium need to know the full path of chromedriver? Does chromedriver or chrome need to be running in the background?