Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Followed this post -

Error comes up at selenium.start(). I am using Selenium RC (2.16), junit(4.5) in Eclipse IDE.

The only way to overcome this issue is to redeploy our framework in Tomcat server, just restart everything.

This is the piece of code that starts Selenium:

private static HttpCommandProcessor proc;
    public static DefaultSelenium selenium;

    if (selenium == null) {

        proc = new HttpCommandProcessor("localhost", 4444, browserName,
        selenium = new DefaultSelenium(proc);

The Selenium Server is already started when the execution reaches the above code.

Below is the exception that comes up when execute the tests:

java.lang.RuntimeException: Could not start Selenium session: Failed to start new browser session: Error while launching browser
      at com.thoughtworks.selenium.DefaultSelenium.start(
      at <package>.SuperClass.connectToUrl(

Any help or clue to resolve this thing would be appreciated!

share|improve this question
Did you run netstat -an | find "4444" to see if selenium server was already running? It sounds like if that's the case you would have to kill the selenium server process and to avoid this in the future, you would want to make sure you are always calling selenium.stop() in your cleanup. – Sam Woods Jul 17 '12 at 20:42
I have not done a netstat but do call the url -localhost:4444/selenium-server/driver/… from the browser, to see incase the server is up, will shut it down. And yes, selenium.stop() is always called in the after class method. – Tahir Shabbir Jul 18 '12 at 4:46
Can you provide entire stack trace? It might contain another useful message in the middle line. – Misha Akovantsev Jan 11 '13 at 2:13

It is possible you are running an incompatible version of Firefox with your Selenium version. As mentioned in another question you asked, Selenium RC 2.16 is only compatible up to Firefox 11. After that, you need webdriver. Here is a link to that question:

Firefox browser launches blank when the tests via Selenium

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.