1

Followed this post - Selenium - Could not start Selenium session: Failed to start new browser session: Error while launching browser

Error comes up at selenium.start(). I am using selenium rc(2.16) , junit(4.5) in eclipse ide.

The only way to over come 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,
                urlName);
        selenium = new DefaultSelenium(proc);
        **selenium.start();**
        selenium.setTimeout(String.valueOf(PAGE_TIMEOUT_TIME));
        selenium.useXpathLibrary("javascript-xpath");
        selenium.deleteAllVisibleCookies();             
    }

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(DefaultSelenium.java:107)
  at <package>.SuperClass.connectToUrl(SuperClass.java:340)

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

Community
  • 1
  • 1
Tahir Shabbir
  • 113
  • 1
  • 2
  • 14

0 Answers0