I am having trouble getting chromedriver on Travis-CI working for my project knockout-secure-binding. I am trying to use WebdriverJS to automate testing with Chrome, at the least.
I noted that there seems to be some issues with chromedriver on Travis-CI, including:
- http://github.com/travis-ci/travis-ci/issues/938
- http://github.com/travis-ci/travis-ci/issues/272
- https://code.google.com/p/chromedriver/issues/detail?id=308
The issue seems to be a variant of "chrome not reachable", and from what I can gather it requires an upstream engagement by Google to fix it.
The details of the error are available through the Travis build log.
No workaround is apparent, though one comment mentioned using --no-sandbox
, but it is not clear where or how one would employ this in WebdriverJS.
Any thoughts on this would be sincerely appreciated.
—— Edit ——
As a matter of interest I am using Sauce Labs in lieu of Chromedriver.
I think Travis does support chrome driver, if you add these in your travis.yml, extract the right chromedriver and unzip it to a known location, so that you can trace it later.
Plus when you call selenium or any testing automation library, you would need to add this the code here is in
Python
but this can be done inJava
andRuby
as well.EDIT: As of October 2018, Travis CI is slowly moving away from containers (see official announcement). Therefore, one can omit
sudo: false
, but the given ChromeDriver setup still works.If you want to use a container-based environment (fast boot time but noyou can also do it as follows (includesudo
),language
and so forth accordingly):Afterwards, as you already mentioned, add
--no-sandbox
to your Chrome options (taken from this gist):This is due to an issue in Travis CI. However, if you need
sudo
anyway or have a long-running build where a container-based environment makes only limited sense, you can also setsudo: true
and omit adding--no-sandbox
.Additional resources:
There's an easier way to launch Chrome on Travis CI, simply specify google-chrome in addons/apt/sources and google-chrome-package in addons/apt/packages.
Here's my sample config for a better understanding: