7

I'm running a docker (That I built on my own), that's docker running E2E tests. The browser is up and running but I want to have another nice to have feature, I want the ability of watching the session online.

My docker run command is:

docker run -p 4444:4444 --name ${DOCKER_TAG_NAME} 
           -e Some_ENVs 
           -v Volume:Volume 
           --privileged 
           -d "{docker-registry}" >> /dev/null 2>&1

I'm able to export screenshots but in some cases it's not enough and the ability of watching what is the exact state of the test would be amazing. I tried a lot of options but I came to a dead end, Any help would be great.

  • My tests are in Python 2.7
  • My Docker base is ubuntu:14.04
  • My environment is in AWS (If that's matter)
  • The docker runs on Ubuntu servers.

  • I know it a duplicate of this but no one answered him so...

Yonatan Kiron
  • 2,718
  • 1
  • 20
  • 25
  • This might help: http://stackoverflow.com/questions/12050021/how-to-make-xvfb-display-visible – Florent B. Aug 01 '16 at 18:28
  • I already looked at this question, the thing is that my problem is not watching the session from the server that the docker runs on, it's that I want to watch the session that inside the docker that inside a server. Thanks for trying to help – Yonatan Kiron Aug 02 '16 at 05:46
  • I think this answer should be also the solution for your problem: [can-you-run-gui-apps-in-a-docker-container](https://stackoverflow.com/questions/16296753/can-you-run-gui-apps-in-a-docker-container/43082473#43082473) – toschneck Apr 18 '18 at 09:30

2 Answers2

2

There is a recent tool called Selenoid. It is launching browsers in Docker containers (i.e. headless as you require). It has a standalone UI capable to show live session screen via VNC. So you can launch multiple sessions in parallel and then look and even intercept actions happening in target browser. All this stuff perfectly works in cloud environment.

vania-pooh
  • 2,933
  • 4
  • 24
  • 42
  • Sounds very promising, I'm giving it a shot, but for it's not getting well.. https://github.com/aerokube/selenoid/issues/102 I will update how is it going. Thanks a log! – Yonatan Kiron May 28 '17 at 11:33
  • Already answered there. Please try with these images: https://hub.docker.com/r/selenoid/vnc/ – vania-pooh May 28 '17 at 12:43
0

I have faced the same issue before with vnc, you need to know your xvfb/vnc in which port is using then open that port on you aws secuirty group once you done with that then you should be able to connect.

On my case i was starting selenium docker "https://github.com/elgalu/docker-selenium" and used this command to start the docker machine "docker run -d --name=grid -p 4444:24444 -p 5900:25900 \ -v /dev/shm:/dev/shm -e VNC_PASSWORD=hola \ -e SCREEN_WIDTH=1920 -e SCREEN_HEIGHT=1480 \ elgalu/selenium"

The VNC port as per the command is "5900" so i opened that port on instance security group, and connected using VNC viewer on port 5900

Khalid Abdlqader
  • 311
  • 4
  • 11