@@ -73,15 +73,15 @@ docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-fire
73
73
74
74
4 . (Optional) To see what is happening inside the container, head to < http://localhost:7900/?autoconnect=1&resize=scale&password=secret > .
75
75
76
- More details about visualising the container activity, check the [ Debugging] ( #debugging ) section.
76
+ For more details about visualising the container activity, check the [ Debugging] ( #debugging ) section.
77
77
78
78
:point_up : When executing ` docker run ` for an image that contains a browser please use
79
79
the flag ` --shm-size=2g ` to use the host's shared memory.
80
80
81
81
:point_up : Always use a Docker image with a full tag to pin a specific browser and Grid version.
82
82
See [ Tagging Conventions] ( https://github.com/SeleniumHQ/docker-selenium/wiki/Tagging-Convention ) for details.
83
83
84
- ### Try them out in a ready to use GitPod environment!
84
+ ### Try them out in a ready-to- use GitPod environment!
85
85
86
86
[ ![ Open in Gitpod] ( https://gitpod.io/button/open-in-gitpod.svg )] ( https://gitpod.io/#https://github.com/SeleniumHQ/docker-selenium )
87
87
90
90
## Experimental Mult-Arch aarch64/armhf/amd64 Images
91
91
92
92
For experimental docker container images, which run on platforms such as the Mac M1 or Raspberry Pi,
93
- see the community driven repository hosted at
93
+ see the community- driven repository hosted at
94
94
[ seleniumhq-community/docker-seleniarm] ( https://github.com/seleniumhq-community/docker-seleniarm ) .
95
95
These images are built for three separate architectures: linux/arm64 (aarch64), linux/arm/v7 (armhf),
96
96
and linux/amd64.
@@ -446,7 +446,7 @@ $ docker run -d -p 5556:5556 `
446
446
447
447
#### Docker Compose
448
448
[ Docker Compose] ( https://docs.docker.com/compose/ ) is the simplest way to start a Grid. Use the
449
- linked resources below, save them locally, and check the execution instructions on top of each file.
449
+ linked resources below, save them locally and check the execution instructions on top of each file.
450
450
451
451
##### Version 2
452
452
[ ` docker-compose-v2.yml ` ] ( docker-compose-v2.yml )
@@ -477,7 +477,7 @@ Tests execution can be recorded by using the `selenium/video:ffmpeg-4.3.1-202306
477
477
Docker image. One container is needed per each container where a browser is running. This means if you are
478
478
running 5 Nodes/Standalone containers, you will need 5 video containers, the mapping is 1-1.
479
479
480
- Currently, the only way to do this mapping is manually (either starting the containers manually, or through
480
+ Currently, the only way to do this mapping is manually (either starting the containers manually or through
481
481
` docker-compose ` ). We are iterating on this process and probably this setup will be more simple in the future.
482
482
483
483
The video Docker image we provide is based on the ffmpeg Ubuntu image provided by the
@@ -758,15 +758,15 @@ ___
758
758
759
759
### SE_OPTS Selenium Configuration Options
760
760
761
- You can pass ` SE_OPTS ` variable with additional commandline parameters for starting a hub or a node.
761
+ You can pass ` SE_OPTS ` variable with additional command line parameters for starting a hub or a node.
762
762
763
763
``` bash
764
764
$ docker run -d -p 4444:4444 -e SE_OPTS=" --log-level FINE" --name selenium-hub selenium/hub:4.10.0-20230607
765
765
```
766
766
767
767
### SE_JAVA_OPTS Java Environment Options
768
768
769
- You can pass ` SE_JAVA_OPTS ` environment variable to java process.
769
+ You can pass ` SE_JAVA_OPTS ` environment variable to the Java process.
770
770
771
771
``` bash
772
772
$ docker run -d -p 4444:4444 -e SE_JAVA_OPTS=-Xmx512m --name selenium-hub selenium/hub:4.10.0-20230607
@@ -782,7 +782,7 @@ In both cases, it is necessary to tell the Node where the Event Bus is, so it ca
782
782
the purpose of the ` SE_EVENT_BUS_HOST ` , ` SE_EVENT_BUS_PUBLISH_PORT ` and ` SE_EVENT_BUS_SUBSCRIBE_PORT ` environment
783
783
variables.
784
784
785
- In some cases, for example if you want to tag a node, it might be necessary to supply a custom stereotype to the node config. The environement variable ` SE_NODE_STEREOTYPE `
785
+ In some cases, for example, if you want to tag a node, it might be necessary to supply a custom stereotype to the node config. The environment variable ` SE_NODE_STEREOTYPE `
786
786
sets the stereotype entry in the node's ` config.toml ` . An example config.toml file can be found here: [ Setting custom capabilities for matching specific Nodes] ( https://www.selenium.dev/documentation/grid/configuration/toml_options/#setting-custom-capabilities-for-matching-specific-nodes ) .
787
787
788
788
Here is an example with the default values of these environment variables:
@@ -796,7 +796,7 @@ $ docker run -d \
796
796
797
797
### Setting Sub Path
798
798
799
- By default, Selenium is reachable at ` http://127.0.0.1:4444/ ` . Selenium can be configured to use a custom sub path by specifying the ` SE_SUB_PATH `
799
+ By default, Selenium is reachable at ` http://127.0.0.1:4444/ ` . Selenium can be configured to use a custom subpath by specifying the ` SE_SUB_PATH `
800
800
environmental variable. In the example below Selenium is reachable at ` http://127.0.0.1:4444/selenium-grid/ `
801
801
802
802
``` bash
@@ -815,20 +815,20 @@ docker run -d -e SE_SCREEN_WIDTH=1366 -e SE_SCREEN_HEIGHT=768 -e SE_SCREEN_DEPTH
815
815
816
816
### Grid Url and Session Timeout
817
817
818
- In some use cases you might need to set the Grid url to the Node, for example if you'd like to access the BiDi/CDP endpoint.
818
+ In some use cases, you might need to set the Grid URL to the Node, for example, if you'd like to access the BiDi/CDP endpoint.
819
819
This is also needed when you want to use the new ` RemoteWebDriver.builder() ` or ` Augmenter() ` present in Selenium 4
820
820
(since they setup the BiDi/CDP connection implicitly). You can do that through the ` SE_NODE_GRID_URL ` environment
821
821
variable. Setting this env var is needed if you want to see the live view while sessions are executing.
822
822
823
- Grid has a default session timeout of 300 seconds, where the session can be on a stale state until it is killed. You can use
823
+ Grid has a default session timeout of 300 seconds, where the session can be in a stale state until it is killed. You can use
824
824
` SE_NODE_SESSION_TIMEOUT ` to overwrite that value in seconds.
825
825
826
826
827
827
### Session request timeout
828
828
829
829
A new session request is placed in the Session Queue before it is processed, and the request sits in the queue until a matching
830
830
slot is found across the registered Nodes. However, the new session request might timeout if no slot was found. By default, a
831
- request will stay in the queue up to 300 seconds before it a timeout is reached. In addition, an attempt to process the request
831
+ request will stay in the queue for up to 300 seconds before it a timeout is reached. In addition, an attempt to process the request
832
832
is done every 5 seconds (by default).
833
833
834
834
It is possible to override those values through environment variables in the Hub and the SessionQueue (` SE_SESSION_REQUEST_TIMEOUT `
@@ -846,7 +846,7 @@ override the maximum limit by setting both `SE_NODE_MAX_SESSIONS` to a desired n
846
846
` true ` . Nevertheless, running more browser sessions than the available processors is not recommended since you will be overloading
847
847
the resources.
848
848
849
- Overriding this setting has a undesired side effect when video recording is enabled, since more than one browser session might be
849
+ Overriding this setting has an undesired side effect when video recording is enabled since more than one browser session might be
850
850
captured in the same video.
851
851
852
852
### Running in Headless mode
@@ -876,7 +876,7 @@ a value higher than zero to enable this behaviour.
876
876
$ docker run -e SE_DRAIN_AFTER_SESSION_COUNT=5 --shm-size=" 2g" selenium/standalone-firefox:4.10.0-20230607
877
877
```
878
878
879
- With the previous command, the Standalone container will shutdown after 5 sessions have been executed.
879
+ With the previous command, the Standalone container will shut down after 5 sessions have been executed.
880
880
881
881
___
882
882
@@ -888,7 +888,7 @@ Clone the repo and from the project directory root you can build everything by r
888
888
$ VERSION=local make build
889
889
```
890
890
891
- If you need to configure environment variable in order to build the image (http proxy for instance),
891
+ If you need to configure environment variables in order to build the image (http proxy for instance),
892
892
simply set an environment variable ` BUILD_ARGS ` that contains the additional variables to pass to the
893
893
docker context (this will only work with docker >= 1.9)
894
894
905
905
906
906
It is a good practice to check first if the Grid is up and ready to receive requests, this can be done by checking the ` /wd/hub/status ` endpoint.
907
907
908
- A Grid that is ready, composed by a hub and two nodes, could look like this:
908
+ A Grid that is ready, composed of a hub and two nodes, could look like this:
909
909
910
910
``` json
911
911
{
@@ -983,7 +983,7 @@ $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \
983
983
selenium/node-firefox:4.10.0-20230607
984
984
985
985
```
986
- ** Note:** The ` \ ` line delimiter won't work on Windows based terminals, try either ` ^ ` or a backtick.
986
+ ** Note:** The ` \ ` line delimiter won't work on Windows- based terminals, try either ` ^ ` or a backtick.
987
987
988
988
The container health status can be checked by doing ` docker ps ` and verifying the ` (healthy)|(unhealthy) ` status or by
989
989
inspecting it in the following way:
@@ -1032,12 +1032,12 @@ Like this, the script will poll until the Grid is ready, and then your tests wil
1032
1032
1033
1033
___
1034
1034
1035
- ## Install certificates for Chromium based browsers
1035
+ ## Install certificates for Chromium- based browsers
1036
1036
1037
- If you need to install custom certificates, CA, intermediate CA, client certificates (for example enterprise internal CA)
1038
- you can use the different utils come from libnss3-tools.
1039
- Chromium based browser uses nssdb as certificate store.
1040
- Create new nssdb:
1037
+ If you need to install custom certificates, CA, intermediate CA, or client certificates (for example enterprise internal CA)
1038
+ you can use the different utils that come from libnss3-tools.
1039
+ The chromium- based browser uses nssdb as a certificate store.
1040
+ Create a new nssdb:
1041
1041
``` bash
1042
1042
certutil -d sql:$HOME /.pki/nssdb -N
1043
1043
```
@@ -1051,7 +1051,7 @@ certutil -d sql:$HOME/.pki/nssdb -A -t ",," -n <certificate nickname> -i <certif
1051
1051
```
1052
1052
You can find more information [ here] ( https://chromium.googlesource.com/chromium/src/+/master/docs/linux/cert_management.md )
1053
1053
Usage example:
1054
- If your company has internal CA you can create your own dockerimage from selenium node image.
1054
+ If your company has an internal CA you can create your own dockerimage from selenium node image.
1055
1055
You can then install all required internal certificates in your Dockerfile like this:
1056
1056
``` bash
1057
1057
FROM selenium/node-edge:latest
@@ -1082,15 +1082,15 @@ As an alternative, you can add your certificate files to existing Selenium image
1082
1082
assumes you have a known image to use as a build image and have a way to publish new images to your local
1083
1083
docker registry.
1084
1084
1085
- This example uses a RedHat based distro as build image (Rocky Linux) but it can be * any* linux image of your choice.
1086
- Please note that build instrutions will vary between distributions. You can check instructions for Ubuntu
1087
- in previous example.
1085
+ This example uses a RedHat- based distro as a build image (Rocky Linux) but it can be * any* Linux image of your choice.
1086
+ Please note that build instruction will vary between distributions. You can check the instructions for Ubuntu
1087
+ in the previous example.
1088
1088
1089
1089
The example also assumes your internal CA is already in * /etc/pki/ca-trust/source/anchors/YOUR_CA.pem* ,
1090
1090
the default location for Rocky Linux. Alternatively, you can also provide these files from your host and
1091
- copy them into build image.
1091
+ copy them into the build image.
1092
1092
1093
- For Chrome and Edge browsers, the recipe is the same, just adapt image name (node-chrome or node-edge):
1093
+ For Chrome and Edge browsers, the recipe is the same, just adapt the image name (node-chrome or node-edge):
1094
1094
```
1095
1095
# Get a standard image for creating nssdb file
1096
1096
FROM rockylinux:8.6 as build
@@ -1126,7 +1126,7 @@ ___
1126
1126
1127
1127
## Debugging
1128
1128
1129
- This project uses [ x11vnc] ( https://github.com/LibVNC/x11vnc ) as VNC server to allow users inspect what is happening
1129
+ This project uses [ x11vnc] ( https://github.com/LibVNC/x11vnc ) as a VNC server to allow users to inspect what is happening
1130
1130
inside the container. Users can connect to this server in two ways:
1131
1131
1132
1132
### Using a VNC client
@@ -1158,8 +1158,8 @@ If you want to run VNC in view-only mode you can set the environment variable `S
1158
1158
1159
1159
### Using your browser (no VNC client is needed)
1160
1160
1161
- This project uses [ noVNC] ( https://github.com/novnc/noVNC ) to allow users inspect visually container activity with
1162
- their browser. This might come handy if you cannot install a VNC client on your machine. Port 7900 is used to start
1161
+ This project uses [ noVNC] ( https://github.com/novnc/noVNC ) to allow users to inspect visually container activity with
1162
+ their browser. This might come in handy if you cannot install a VNC client on your machine. Port 7900 is used to start
1163
1163
noVNC, so you will need to connect to that port with your browser.
1164
1164
1165
1165
Similarly to the previous section, feel free to map port 7900 to any free external port that you wish.
@@ -1179,11 +1179,17 @@ Then, you would use in your browser:
1179
1179
1180
1180
If you get a prompt asking for a password, it is: ` secret ` .
1181
1181
1182
+ ### Disabling VNC
1183
+ If You are running low on resources, or simply don't need to inspect running sessions, it is possible to not run VNC at all.
1184
+ Just set
1185
+ ``` SE_START_VNC=false ```
1186
+ environment variable on the grid startup.
1187
+
1182
1188
___
1183
1189
1184
1190
## Tracing in Grid
1185
1191
1186
- In order to enable tracing in Selenium Grid container, the following commands can be executed:
1192
+ In order to enable tracing in the Selenium Grid container, the following commands can be executed:
1187
1193
1188
1194
``` bash
1189
1195
docker network create grid
@@ -1261,7 +1267,7 @@ A common scenario is mounting a volume to the browser
1261
1267
container in order to retrieve downloaded files. This
1262
1268
works well in Windows and macOS but not without
1263
1269
workarounds in Linux. For more details, check this
1264
- well documented [ issue] ( https://github.com/SeleniumHQ/docker-selenium/issues/1095 ) .
1270
+ well- documented [ issue] ( https://github.com/SeleniumHQ/docker-selenium/issues/1095 ) .
1265
1271
1266
1272
For example, while using Linux, you might be starting a
1267
1273
container in the following way:
@@ -1275,12 +1281,12 @@ docker run -d -p 4444:4444 --shm-size="2g" \
1275
1281
That will mount the host ` /home/ubuntu/files ` directory
1276
1282
to the ` /home/seluser/files ` inside the container. The
1277
1283
problem happens because the volume will be mounted as
1278
- ` root ` , and therefore the browser cannot write a file to
1284
+ ` root ` ; therefore, the browser cannot write a file to
1279
1285
that directory because it is running under the user
1280
1286
` seluser ` . This happens because that is how Docker mounts
1281
1287
volumes in Linux, more details in this [ issue] ( https://github.com/moby/moby/issues/2259 ) .
1282
1288
1283
- A workaround for this is to create the directory on the
1289
+ A workaround for this is to create a directory on the
1284
1290
host and change its permissions ** before mounting the volume** .
1285
1291
Depending on your user permissions, you might need to use
1286
1292
` sudo ` for some of these commands:
0 commit comments