From 44975b2f77f4ffb484553777f3bc07d0e0a02432 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jim=20Br=C3=A4nnlund?= Date: Thu, 8 Nov 2018 15:00:26 +0100 Subject: [PATCH 1/2] Document the newly added environment variable --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 732774e329..b58b0c3551 100644 --- a/README.md +++ b/README.md @@ -263,6 +263,19 @@ should also be at least 5. Full example: $ docker run -d -e HUB_HOST= -e NODE_MAX_INSTANCES=5 -e NODE_MAX_SESSION=5 selenium/node-firefox:3.141.5-astatine ``` +### Running in Headless mode + +Both [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode) and [Chrome](https://developers.google.com/web/updates/2017/04/headless-chrome) support running tests in headless mode. +When using headless mode, there's no need for the [Xvfb](https://en.wikipedia.org/wiki/Xvfb) server to be started. + +To avoid starting the server you can set the `START_XVFB` environment variable to `false` (or any other value than `true`), for example: + +``` bash +$ docker run -d --net grid -e HUB_HOST=selenium-hub -e START_XVFB=false -v /dev/shm:/dev/shm selenium/node-chrome +``` + +For more information, see this Github [issue](https://github.com/SeleniumHQ/docker-selenium/issues/567). + ## Building the images Clone the repo and from the project directory root you can build everything by running: From ef2520bcd5998c74cd1841505e524b4f2d838b8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jim=20Br=C3=A4nnlund?= Date: Thu, 8 Nov 2018 19:29:41 +0100 Subject: [PATCH 2/2] Add troubleshooting tips for Headless --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index b58b0c3551..533193fd72 100644 --- a/README.md +++ b/README.md @@ -478,3 +478,15 @@ You can turn on debugging by passing environment variable to the hub and the nod ``` GRID_DEBUG=true ``` + +#### Headless + +If you see the following selenium exceptions: + +`Message: invalid argument: can't kill an exited process` + +or + +`Message: unknown error: Chrome failed to start: exited abnormally` + +The reason _might_ be that you've set the `START_XVFB` environment variable to "false", but forgot to actually run Firefox or Chrome (respectively) in headless mode.