selenium.start()中的运行时异常 - 无法启动Selenium会话:无法启动新的浏览器会话:启动浏览器时出错

时间:2012-07-17 10:22:22

标签: selenium

关注这篇文章 - Selenium - Could not start Selenium session: Failed to start new browser session: Error while launching browser

selenium.start()出现错误。 我在eclipse ide中使用selenium rc(2.16),junit(4.5)。

解决此问题的唯一方法是在tomcat服务器中重新部署我们的框架,只需重新启动所有内容。

这是启动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();             
    }

当执行到达上面的代码时,selenium服务器已经启动。

以下是执行测试时出现的异常 -

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)

任何帮助或线索来解决这个问题都将不胜感激!

0 个答案:

没有答案