Skip to content

Commit e8818d9

Browse files
BeyondEvildiemol
authored andcommitted
Document the newly added environment variable (SeleniumHQ#836)
* Document the newly added environment variable * Add troubleshooting tips for Headless
1 parent 31cacd4 commit e8818d9

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,19 @@ should also be at least 5. Full example:
263263
$ docker run -d -e HUB_HOST=<hub_ip|hub_name> -e NODE_MAX_INSTANCES=5 -e NODE_MAX_SESSION=5 selenium/node-firefox:3.141.5-astatine
264264
```
265265

266+
### Running in Headless mode
267+
268+
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.
269+
When using headless mode, there's no need for the [Xvfb](https://en.wikipedia.org/wiki/Xvfb) server to be started.
270+
271+
To avoid starting the server you can set the `START_XVFB` environment variable to `false` (or any other value than `true`), for example:
272+
273+
``` bash
274+
$ docker run -d --net grid -e HUB_HOST=selenium-hub -e START_XVFB=false -v /dev/shm:/dev/shm selenium/node-chrome
275+
```
276+
277+
For more information, see this Github [issue](https://github.com/SeleniumHQ/docker-selenium/issues/567).
278+
266279
## Building the images
267280

268281
Clone the repo and from the project directory root you can build everything by running:
@@ -465,3 +478,15 @@ You can turn on debugging by passing environment variable to the hub and the nod
465478
```
466479
GRID_DEBUG=true
467480
```
481+
482+
#### Headless
483+
484+
If you see the following selenium exceptions:
485+
486+
`Message: invalid argument: can't kill an exited process`
487+
488+
or
489+
490+
`Message: unknown error: Chrome failed to start: exited abnormally`
491+
492+
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.

0 commit comments

Comments
 (0)