0

I perform headless web session tests with selenium (python, ubuntu server 15, firefox), which can last for hours. I do make use of pyvirtualdisplay + xvfb.

My python scripts begin like this:

from pyvirtualdisplay import Display

virtualdisplay = True

if virtualdisplay:
    display = Display(visible=0, size=(1920, 1240))
    display.start()

How is it possible to peep what's goin' on without actually get screenshots, e.g. vnc session?

I tried several solutions, but they didn't work because perhaps they are outdated or too general.

fab
  • 164
  • 1
  • 13
  • What did you try? How were they insufficient? (Maybe you used them incorrectly.) – Scott Hunter Jan 02 '16 at 23:05
  • Hello, I rolled back a previous virtual machine state so I can't retrieve the history. However I used apt-install install vnc4server vncserver :1 DISPLAY=:1 export DISPLAY But it seemed unlatched from the ongoing session, perhaps a new on-demand session. The tools I'm using in my current setup are quite the standard for headless browsing, so what can I use to setup a standard "live peep" procedure? – fab Jan 02 '16 at 23:44
  • doing stress test with selenium is little bit crazy. You may simulate opening tons of browsers but it will not much because of the hardware limit. Every time selenium opens a fresh browser so you can not capture previous sessions. – Mesut GUNES Jan 03 '16 at 22:29
  • Please forget about stress test if this term generates confusion (I also reedited the question). I open 1 single browser session which can perform actions for hours. How can inspect that session? – fab Jan 04 '16 at 17:45

1 Answers1

0

using x11vnc can do the trick. Just add this line to bash script you are using to launch tests:

x11vnc -q -bg -display $DISPLAY

After that you can connect to your virtual display on default port 5900 (or any other of your choice). Keys -q and -bg forces x11vnc to be quiet and run in background respectively. Of course, you should set up port forwarding for SSH connection:

ssh -L 5900:localhost:5900 yourhost
FireHawk
  • 16
  • 1