How to watch an xvfb session that is inside the docker on a remote server from my local browser?

I run a docker (which I built myself), this docker works with E2E tests. The browser works, but I want to have another nice feature, I want you to be able to watch the session online.

My docker run :

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

I can export screenshots, but in some cases this is not enough, and the ability to see what the exact state of the test is will be amazing. I tried many options, but I came to a standstill. Any help would be great.

  • My tests are in Python 2.7
  • My Docker ubuntu:14.04 base ubuntu:14.04
  • My environment is in AWS (if that matters)
  • Docker runs on Ubuntu servers.

  • I know this is a duplicate of this , but no one has answered it that way ...

+5
source share
2 answers

There is a recent tool called Selenoid . It launches browsers in Docker containers (i.e. headless, as you need). It has a standalone UI capable of displaying a live session screen through VNC . This way, you can run multiple sessions in parallel, and then view and even intercept the actions taking place in the target browser. All this works great in the cloud.

+2
source

I ran into the same problem as vnc, you need to know your xvfb / vnc, which uses the port, then open that port on your aws secuirty group after you do this, then you can connect.

In my case, I started 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 is according to the "5900" command, so I opened this port in the instance security group and connected using the VNC viewer to port 5900

0
source

All Articles