Last time I wrote how to record selenium testing to mp4 with ffmpeg.. This time I would like to show how to connect to Xvfb and watch selenium testing live.
So as I wrote earlier we are using multiple builds to get all tests in under 10 minutes instead of hour+. Unfortunately selenium is not the most stable software available and sometimes after upgrade to new version there are “problems”. Without option to debug them by clicking in the browser it’s just pain in the ass to debug and get necessary informations what is wrong.
Fortunately it is easy to get working VNC server and with it connecting and debugging “live” is easy as doing it on your own computer.
First you have to run selenium server inside Xvfb. Make it listen for tcp connection and save the auth-file for easier connection:
Then install x11vnc and create password file:
And the last step is to run x11vnc server:
If you want to automate it just create systemd service file/template and that’s all. Now you can easily connect to Xvfb and play with browser running tests orchestrated by selenium.