Followed this post - https://stackoverflow.com/questions/1414934/selenium-could-not-start-selenium-session-failed-to-start-new-browser-session
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,
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!