From 58ad853ce8967a7c1286a9796d3ad20973666b29 Mon Sep 17 00:00:00 2001 From: Matthew Smith Date: Thu, 20 Nov 2014 11:19:01 -0700 Subject: [PATCH] Update README with debugging instructions Part of #3 --- README.md | 42 ++++++++++++++++++++++++++++++++++++------ bin/vncview | 6 ++++++ 2 files changed, 42 insertions(+), 6 deletions(-) create mode 100755 bin/vncview diff --git a/README.md b/README.md index 421049127d..c2792bfffb 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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. @@ -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 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://: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 /home/seluser/.vnc/passwd +``` + ##### Look around ``` bash diff --git a/bin/vncview b/bin/vncview new file mode 100755 index 0000000000..7e8c615def --- /dev/null +++ b/bin/vncview @@ -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 $@