My Selenium headless tests are triggered from Jenkins server and run in EC2-Ubuntu. I want to view the test live on Chrome so I installed Xvfb plugin on Jenkins.
On EC2 I installed Xvfb. When I start executing the build, my test starts execution and I see below logs:
Xvfb /usr/bin/Xvfb :1 -fbdir /var/lib/jenkins/xvfb-27-..fbdir13700092919317283985
Parsing POMs
Established TCP socket on 30810
and I see the test is running successfully.
Now I do SSH to EC2 from Mac terminal by
ssh -L 5901:localhost:5901 [email protected]
Then I execute:
qa_user@jenkins-it:~$ export DISPLAY=: 30810 (Port number from Jenkins logs above)
qa_user@jenkins-it:~$ vncserver "$DISPLAY" -geometry 1280x1024
New 'X' desktop is jenkins-it: 30810
Starting applications specified in /home/qa_user/.vnc/xstartup
Log file is /home/qa_user/.vnc/jenkins-it: 30810.log
qa_user@jenkins-it:~$ x11vnc --listen 0.0.0.0 -rfbport 5901 -display : 30810
This starts XVFB and I see:
Now when I connect from Mac to localhost:5901 from VNCviewer, I am taken to Ubuntu desktop.
But I don't see chrome opening up even though the test is running and I see test logs on Jenkins.
I am also able to use Chrome via VncViewer.
What am I missing here? I tried many Xvfb set up instructions and has been trying to get this right since a month now. Here are few questions I asked:
Looking for a solution to run selenium tests on EC2 with GUI
Long way till here and now Stackoverflow is my last resort. Please help.