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
The project is made possible by volunteer contributors who have put in thousands of hours of their own time, and made the source code freely available under the [Apache 2.0 license](https://raw.githubusercontent.com/SeleniumHQ/selenium/master/LICENSE).
1
+
The project is made possible by volunteer contributors who have put in thousands of hours of their own time, and made the source code freely available under the [Apache License 2.0](https://raw.githubusercontent.com/SeleniumHQ/selenium/master/LICENSE).
Copy file name to clipboardExpand all lines: README.md
+23-30Lines changed: 23 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -1,25 +1,24 @@
1
1
# Selenium Docker
2
2
3
-
The project is made possible by volunteer contributors who have put in thousands of hours of their own time, and made the source code freely available under the [Apache 2.0 license](https://code.google.com/p/selenium/source/browse/COPYING).
3
+
The project is made possible by volunteer contributors who have put in thousands of hours of their own time, and made the source code freely available under the [Apache License 2.0](https://github.com/SeleniumHQ/docker-selenium/blob/master/LICENSE.md).
4
4
5
5
## Docker images for Selenium Standalone Server Hub and Node configurations with Chrome and Firefox
$ docker run -d -p 4444:4444 selenium/standalone-firefox:2.46.0
32
31
```
33
32
34
-
Note: only one standalone image can run on port 4444 at a time.
33
+
_Note: Only one standalone image can run on port_`4444`_at a time._
35
34
36
-
To inspect visually what the browser is doing use the `standalone-chrome-debug` or `standalone-firefox-debug` images. [See debugging section for more...](#debugging)
35
+
To inspect visually what the browser is doing use the `standalone-chrome-debug` or `standalone-firefox-debug` images. See [Debugging](#debugging) section for details.
37
36
38
37
### Selenium Grid Hub
39
38
40
39
```bash
41
40
$ docker run -d -p 4444:4444 --name selenium-hub selenium/hub:2.46.0
42
41
```
43
42
44
-
### Chrome and Firefox Nodes
43
+
### Chrome and Firefox Grid Nodes
45
44
46
45
```bash
47
46
$ docker run -d --link selenium-hub:hub selenium/node-chrome:2.46.0
Ensure you have the `ubuntu:14.04` base image downloaded, this step is _optional_ since docker takes care of downloading the parent base image automatically.
60
+
Ensure you have the `ubuntu:14.04` base image downloaded, this step is _optional_ since Docker takes care of downloading the parent base image automatically.
62
61
63
62
```bash
64
63
$ docker pull ubuntu:14.04
@@ -70,11 +69,11 @@ Clone the repo and from the project directory root you can build everything by r
70
69
$ VERSION=local make build
71
70
```
72
71
73
-
_Note: omitting`VERSION=local`will build the images with the current version number thus overwriting the images downloaded from dockerhub._
72
+
_Note: Omitting_`VERSION=local`_will build the images with the current version number thus overwriting the images downloaded from [Docker Hub](https://registry.hub.docker.com/)._
74
73
75
74
## Using the images
76
75
77
-
##### e.g. Spawn a container for Chrome testing:
76
+
##### Example: Spawn a container for testing in Chrome:
78
77
79
78
```bash
80
79
$ docker run -d --name selenium-hub -p 4444:4444 selenium/hub:2.46.0
@@ -83,13 +82,11 @@ $ CH=$(docker run --rm --name=ch \
83
82
selenium/node-chrome:2.46.0)
84
83
```
85
84
86
-
Note `-v /e2e/uploads:/e2e/uploads` is optional in case you are testing browser uploads on your webapp you'll probably need to share a directory for this.
87
-
88
-
I like to remove the containers after each e2e test with `--rm` since this docker container is not meant to preserve state, spawning a new one is less than 3 seconds. You need to think of your docker containers as single processes, not as running virtual machines, in case you are familiar with vagrant.
85
+
_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._
89
86
90
-
##### e.g. Spawn a container for Firefox testing:
87
+
##### Example: Spawn a container for testing in Firefox:
91
88
92
-
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 avoid certain `:focus` issues you web app may encounter during e2e automation.
89
+
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.
93
90
94
91
```bash
95
92
$ docker run -d --name selenium-hub -p 4444:4444 selenium/hub:2.46.0
@@ -98,44 +95,41 @@ $ FF=$(docker run --rm --name=fx \
98
95
selenium/node-firefox:2.46.0)
99
96
```
100
97
101
-
## Debugging
98
+
_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/)._
102
99
103
-
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.
100
+
## Debugging
104
101
102
+
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:
105
103
```bash
106
104
$ docker run -d -P --link selenium-hub:hub selenium/node-chrome-debug:2.46.0
107
105
$ docker run -d -P --link selenium-hub:hub selenium/node-firefox-debug:2.46.0
108
106
```
109
107
110
108
And for standalone:
111
-
112
109
```bash
113
110
$ docker run -d -p 4444:4444 selenium/standalone-chrome-debug:2.46.0
114
111
# OR
115
112
$ docker run -d -p 4444:4444 selenium/standalone-firefox-debug:2.46.0
116
113
```
117
114
118
115
You can acquire the port that the VNC server is exposed to by running:
119
-
120
116
```bash
121
117
$ docker port <container-name|container-id> 5900
122
118
#=> 0.0.0.0:49338
123
119
```
124
120
125
-
In case you have RealVNC binary `vnc` in your path, you can always take a look, view only to avoid messing around your tests with an unintended mouse click or keyboard.
126
-
121
+
In case you have [RealVNC](https://www.realvnc.com/) binary `vnc` in your path, you can always take a look, view only to avoid messing around your tests with an unintended mouse click or keyboard interrupt:
127
122
```bash
128
123
$ ./bin/vncview 127.0.0.1:49160
129
124
```
130
125
131
-
If you are running Boot2Docker on Mac then you already have a [VNC client](http://www.davidtheexpert.com/post.php?id=5) built-in. You can connect by entering `vnc://<boot2docker-ip>:49160` in Safari or [Alfred](http://www.alfredapp.com/)
132
-
133
-
When you are prompted for the password it is __secret__. If you wish to change this then you should either change it in the `/NodeBase/Dockerfile` and build the images yourself, or you can define a docker image that derives from the posted ones which reconfigures it:
126
+
If you are running [Boot2Docker](https://docs.docker.com/installation/mac/) on OS X then you already have a [VNC client](http://www.davidtheexpert.com/post.php?id=5) built-in. You can connect by entering `vnc://<boot2docker-ip>:49160` in Safari or [Alfred](http://www.alfredapp.com/).
134
127
128
+
When you are prompted for the password it is `secret`. If you wish to change this then you should either change it in the `/NodeBase/Dockerfile` and build the images yourself, or you can define a Docker image that derives from the posted ones which reconfigures it:
135
129
```dockerfile
136
130
#FROM selenium/node-chrome-debug:2.46.0
137
131
#FROM selenium/node-firefox-debug:2.46.0
138
-
#Choose the FROM statement that works for you.
132
+
#Choose the FROM statement that works for you.
139
133
140
134
RUN x11vnc -storepasswd <your-password-here> /home/seluser/.vnc/passwd
0 commit comments