Can I run Selenium scripts without starting the X server?

I have a python script that uses selenium RC; specially webdriver.

I would like the script to execute as a hook after committing, ideally via IE, Safari (if possible), Chrome and Firefox.

But I'm not sure what I need to do, since every time I launch it on my local computer, a browser appears.

I heard about "saucelabs". Is this the best solution?

+8
python selenium selenium-webdriver selenium-rc headless
Feb 09 '12 at 8:08
source share
1 answer

Yes, you need to start the X server, because Selenium requires a working browser, and the browser needs some kind of X server to run.

Fortunately, there are many types of X-servers, and one of them is Xvfb aka X virtual framebuffer, which performs all operations in memory and, therefore, does not require a screen.

Wikipedia also has some beautiful examples .

There are also many SO questions for the headless , xvfb and selenium keywords. Choose wisely;)

[Edit] : Here is a good example .

+11
Feb 09 2018-12-12T00:
source share



All Articles