Pull image
docker pull elgalu/selenium
Run a new grid
docker run --rm --name=grid -p 4444:24444 -p 5920:25900 \
--shm-size=1g -e VNC_PASSWORD=hola \
-e VIDEO=true elgalu/selenium
Wait for the grid to start
docker exec grid wait_all_done 30s
Check your grid has Chrome and Firefox.
OSX: replace localhost
with boot2docker ip
or docker-machine ip default
.
open http://localhost:4444/grid/console
Run your tests
#at http://localhost:4444/wd/hub
Stopping the grid will also stop video recording and close the file properly. However is better to stop the video service first then copy the videos to the host machine.
docker exec grid stop-video
mkdir -p ./videos
docker cp grid:/videos/. videos
docker exec grid stop
docker stop grid
Check your video, note it may be splitted in many files if is too long
vlc videos/test.mp4
Start and stop on-demand
docker exec grid start-video
Now run your tests
Then stop. Follow the steps in the Stop section