You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, nodes start with a screen resolution of 1360 x 1020 with a color depth of 24 bits and a dpi of 96. These settings can be adjusted by specifying `SCREEN_WIDTH`, `SCREEN_HEIGHT`, `SCREEN_DEPTH`, and/or `SCREEN_DPI` environmental variables when starting the container.
160
+
By default, nodes start with a screen resolution of 1360 x 1020 with a color depth of 24 bits and a dpi of 96.
161
+
These settings can be adjusted by specifying `SCREEN_WIDTH`, `SCREEN_HEIGHT`, `SCREEN_DEPTH`, and/or `SCREEN_DPI`
162
+
environmental variables when starting the container.
Bear in mind that in non-debug images, the maximize window command won't work. You can use the resize window command
171
-
instead. Also, some browser drivers allow specifying window size in capabilities.
172
-
173
168
### Running in Headless mode
174
169
175
-
[Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode), [Chrome](https://developers.google.com/web/updates/2017/04/headless-chrome) and [Opera](https://forums.opera.com/topic/20375/opera-cli-switches-and-headless) support running tests in headless mode.
For more information, see this Github [issue](https://github.com/SeleniumHQ/docker-selenium/issues/567).
182
+
For more information, see this GitHub [issue](https://github.com/SeleniumHQ/docker-selenium/issues/567).
183
+
___
185
184
186
185
## Building the images
187
186
@@ -191,53 +190,43 @@ Clone the repo and from the project directory root you can build everything by r
191
190
$ VERSION=local make build
192
191
```
193
192
194
-
If you need to configure environment variable in order to build the image (http proxy for instance), simply set an environment variable `BUILD_ARGS` that contains the additional variables to pass to the docker context (this will only work with docker >= 1.9)
193
+
If you need to configure environment variable in order to build the image (http proxy for instance),
194
+
simply set an environment variable `BUILD_ARGS` that contains the additional variables to pass to the
195
+
docker context (this will only work with docker >= 1.9)
195
196
196
197
```bash
197
198
$ BUILD_ARGS="--build-arg http_proxy=http://acme:3128 --build-arg https_proxy=http://acme:3128" make build
198
199
```
199
200
200
-
_Note: Omitting_`VERSION=local`_will build the images with the current version number thus overwriting the images downloaded from [Docker Hub](https://hub.docker.com/r/selenium/)._
201
+
_Note: Omitting_`VERSION=local`_will build the images with the released version but replacing the date for the
202
+
current one._
201
203
202
204
## Using the images
203
205
204
-
##### Example: Spawn a container for testing in Chrome:
205
-
206
-
```bash
207
-
$ docker run -d --name selenium-hub -p 4444:4444 selenium/hub:4.0.0-alpha-6-20200730
_Note:_`-v /e2e/uploads:/e2e/uploads`_is optional in case you are testing browser uploads on your web app you will probably need to share a directory for this._
215
-
216
-
##### Example: Spawn a container for testing in Firefox:
217
-
218
-
This command line is the same as for Chrome. Remember that the Selenium running container is able to launch either Chrome or Firefox, the idea around having 2 separate containers, one for each browser is for convenience plus avoiding certain `:focus` issues your web app may encounter during end-to-end test automation.
206
+
### Example: Spawn a container for testing in Firefox :
219
207
220
208
```bash
221
-
$ docker run -d --name selenium-hub -p 4444:4444 selenium/hub:4.0.0-alpha-6-20200730
_Note: Since a Docker container is not meant to preserve state and spawning a new one takes less than 3 seconds you will likely want to remove containers after each end-to-end test with_`--rm`_command. You need to think of your Docker containers as single processes, not as running virtual machines, in case you are familiar with [Vagrant](https://www.vagrantup.com/)._
217
+
_Note:_`-v /e2e/uploads:/e2e/uploads`_is optional in case you are testing browser uploads on your
218
+
web app you will probably need to share a directory for this._
229
219
230
-
##### Example: Spawn a container for testing in Opera:
220
+
This command line for Opera or Chrome is the virtually the same, only remember to replace the image name for
221
+
`node-opera` or `node-crhome`. Remember that the Selenium running container is able to launch either
222
+
Chrome, Opera or Firefox, the idea around having 3 separate containers, one for each browser is for convenience plus
223
+
avoiding certain `:focus` issues your web app may encounter during end-to-end test automation.
231
224
232
-
```bash
233
-
$ docker run -d --name selenium-hub -p 4444:4444 selenium/hub:4.0.0-alpha-6-20200730
_Note: Since a Docker container is not meant to preserve state and spawning a new one takes less than 3 seconds you
226
+
will likely want to remove containers after each end-to-end test with_`--rm`_command. You need to think of your
227
+
Docker containers as single processes, not as running virtual machines._
239
228
240
-
_Note:_`-v /e2e/uploads:/e2e/uploads`_is optional in case you are testing browser uploads on your web app you will probably need to share a directory for this._
229
+
___
241
230
242
231
## Waiting for the Grid to be ready
243
232
@@ -337,6 +326,8 @@ $ ./wait-for-grid.sh mvn clean test
337
326
338
327
Like this, the script will poll until the Grid is ready, and then your tests will start.
339
328
329
+
___
330
+
340
331
## Debugging
341
332
342
333
In the event you wish to visually see what the browser is doing you will want to run the `debug` variant of node or standalone images. A VNC server will run on port 5900. You are free to map that to any free external port that you wish. Keep in mind that you will only be able to run one node per port so if you wish to include a second node, or more, you will have to use different ports, the 5900 as the internal port will have to remain the same though as thats the VNC service on the node. The second example below shows how to run multiple nodes and with different VNC ports open:
@@ -395,7 +386,9 @@ RUN x11vnc -storepasswd <your-password-here> /home/seluser/.vnc/passwd
395
386
396
387
If you want to run VNC without password authentication you can set the environment variable `VNC_NO_PASSWORD=1`.
397
388
398
-
### Troubleshooting
389
+
___
390
+
391
+
## Troubleshooting
399
392
400
393
All output is sent to stdout so it can be inspected by running:
401
394
```bash
@@ -407,7 +400,7 @@ You can turn on debugging by passing environment variable to the hub and the nod
0 commit comments