Is it possible to run selenium (Firefox) web driver without a GUI?

nonshatter picture nonshatter · May 1, 2012 · Viewed 102.9k times · Source

We are considering upgrading our production server from Ubuntu-desktop 10.04 to Ubuntu-server 12.04.

We have various services running on our current desktop OS such as Selenium Web Driver. My question is can the Selenium Web Driver be run from a cli-based system?

My immediate thought is that it can't, because it relies on Firefox, but I'd like for someone to prove me wrong!

Answer

grahaminn picture grahaminn · May 1, 2012

What you're looking for is a .

Yes, it's possible to run Selenium on Firefox headlessly. Here is a post you can follow.

Here is the summary steps to set up Xvfb

#install Xvfb
sudo apt-get install xvfb

#set display number to :99
Xvfb :99 -ac &
export DISPLAY=:99    

#you are now having an X display by Xvfb