Fix “Could not start Selenium session… Error starting browser ” (maven + TestNG + headless unix)

By neokrates, written on April 27, 2010


  • Join date: 11-30-99
  • Posts: 224
View Counter:
Rate it
  • Which frameworks do you use to test your web frontend?

    View Results

    Loading ... Loading ...
  • bodytext bodytext bodytext

That is a common configuration to run many browser tests under selenium. One specific case is headless unix, i.e. hardware without monitor. The problem is to let browser run without X-Server. The described solution allows gui-based browsers to run under selenium. It fixes “Error starting browser” in many, but not all cases.

Important: that fix only applies to headless systems. If on your target system, firefox already running under X-Server, this fix won’t help.

For headless systems it is important, that all gui-based software actually finds an X-Server. If display is not available, xvfb can help (
Don’t forget to properly install and configure Xvfb on the target system. Use apt-get, aptitude, etc… if it is not yet installed.


✔ Maven

✔ TestNG (or any other framework)

✔ Headless Unix

✔ Selenium

✔ Xvfb

The precondition is, that your maven + TestNG + Selenium project is already set up. Then, you have fully configured pom.xml.

Your DISPLAY environment variable is set to :1.0. If no, change <display>:1</display> in the code below accordingly. Add that execution to your pom.xml:


Here is more about selenium-maven-plugin and Xvfb :

Have fun! ;-)

Be Sociable, Share!
Does that help to solve your problem?
VN:F [1.8.5_1061]
Rating: -1 (from 3 votes)
1 votes 'YES'  2 votes 'NO'

LEARN MORE (amazon bookstore)


Be Sociable, Share!


Leave a Reply