Skip to content

Commit

Permalink
Update README with debugging instructions
Browse files Browse the repository at this point in the history
Part of #3
  • Loading branch information
mtscout6 committed Nov 20, 2014
1 parent e3cef83 commit 58ad853
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 6 deletions.
42 changes: 36 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Images included:
- __selenium/node-base__: Base image for Selenium Nodes which includes a virtual desktop environment and VNC support
- __selenium/node-chrome__: Selenium node with Chrome installed, needs to be connected to a Selenium Hub
- __selenium/node-firefox__: Selenium node with Firefox installed, needs to be connected to a Selenium Hub
- __selenium/node-chrome-debug__: Selenium node with Chrome installed and runs a VNC server, needs to be connected to a Selenium Hub
- __selenium/node-firefox-debug__: Selenium node with Firefox installed and runs a VNC server, needs to be connected to a Selenium Hub

## Running the images

Expand All @@ -30,12 +32,6 @@ $ docker run -d --link selenium-hub:hub selenium/node-chrome:2.44.0
$ docker run -d --link selenium-hub:hub selenium/node-firefox:2.44.0
```

### Self contained Selenium container

``` bash
$ docker run -d -p 4444:4444 selenium/full:2.44.0
```

## Building the images

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.
Expand Down Expand Up @@ -78,6 +74,40 @@ $ FF=$(docker run --rm --name=ch \
selenium/node-firefox:2.44.0)
```

## Debugging

In the event you wish to visually see what the browser is doing you will want to run the selenium/node-chrome-debug and selenium/node-firefox-debug images.

``` bash
$ docker run -d -P --link selenium-hub:hub selenium/node-chrome-debug:2.44.0
$ docker run -d -P --link selenium-hub:hub selenium/node-firefox-debug:2.44.0
```

You can acquire the port that the VNC server is exposed to by running:

``` bash
$ docker port <container-name|container-id> 5900
#=> 0.0.0.0:49338
```

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.

``` bash
$ ./bin/vncview 127.0.0.1:49160
```

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/)

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:

``` dockerfile
#FROM selenium/node-chrome-debug:2.44.0
#FROM selenium/node-firefox-debug:2.44.0
# Choose the FROM statement that works for you.

RUN x11vnc -storepasswd <your-password-here> /home/seluser/.vnc/passwd
```

##### Look around

``` bash
Expand Down
6 changes: 6 additions & 0 deletions bin/vncview
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

echo You need RealVNC client to use this script
echo

vnc -WarnUnencrypted=0 -SendKeyEvents=0 -GrabKeyboard=0 SendPointerEvents=0 $@

0 comments on commit 58ad853

Please sign in to comment.