Selenium Grid:无法启动Selenium会话:转发新会话时出错用于安装的VM空池

时间:2012-02-29 09:37:49

标签: selenium-grid

当我通过Selenium网格运行ant目标时,我能够并行启动所有目标。如果我在完成执行之前关闭任何Firefox会话。我明白了:

ERROR Server Exception: sessionId fc89c194951a4790bce8418dac7d5ceb doesn't exist;
     perhaps this session was already stopped?
     [java]  at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)
     [java]  at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:91)
     [java]  at com.thoughtworks.selenium.HttpCommandProcessor.getString(HttpCommandProcessor.java:262)
     [java]  at com.thoughtworks.selenium.HttpCommandProcessor.getStringArray(HttpCommandProcessor.java:271)
     [java]  at com.thoughtworks.selenium.DefaultSelenium.getAllWindowTitles(DefaultSelenium.java:567)
     [java]  at com.operative.qa.automation.util.URLTestContext.seleniumStart(URLTestContext.java:232)
     [java]  at com.operative.qa.automation.util.URLTestContext.CommonLogin(URLTestContext.java:66)
     [java]  at com.operative.qa.automation.main.AutomationFileSequence.main(AutomationFileSequence.java:86)
     [java] java.lang.NullPointerException
     [java]  at com.operative.qa.automation.util.URLTestContext.CommonLogin(URLTestContext.java:78)
     [java]  at com.operative.qa.automation.main.AutomationFileSequence.main(AutomationFileSequence.java:86)
     [java] com.thoughtworks.selenium.SeleniumException:
           org%2Eopenqa%2Egrid%2Ecommon%2Eexception%2EGridException%3A+Session+
           %5Bfc89c194951a4790bce8418dac7d5ceb%5D+not+available+%2D+%5Bext%2E+
           key+1a83ce8d23284bc0ae57545c85f93edf%2C+ext%2E+key+
           9de7dcbcdc29438db917d22773cf3598%5D
     [java]  at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)
     [java]  at com.thoughtworks.selenium.HttpCommandProcessor.getCommandResponseAsString(HttpCommandProcessor.java:168)
     [java]  at com.thoughtworks.selenium.HttpCommandProcessor.executeCommandOnServlet(HttpCommandProcessor.java:104)
     [java]  at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:86)
     [java]  at com.thoughtworks.selenium.HttpCommandProcessor.stop(HttpCommandProcessor.java:252)
     [java]  at com.thoughtworks.selenium.DefaultSelenium.stop(DefaultSelenium.java:112)
     [java]  at com.operative.qa.automation.util.URLTestContext.stop(URLTestContext.java:268)
     [java]  at com.operative.qa.automation.main.AutomationFileSequence.main(AutomationFileSequence.java:114)

我该如何解决这个问题?

有没有办法停止Selenium会话。有时,如果我手动关闭Firefox浏览器以停止执行并关闭服务器。仍然,执行继续并将所有测试用例标记为失败。如何摆脱这个?

我正在使用:Selenium RC with grid 2

2 个答案:

答案 0 :(得分:0)

关闭浏览器不会停止执行。您必须使用用于测试启动的任何程序或使用RunNotifier中的pleaseStop()来停止它。

答案 1 :(得分:0)

我从任务管理器停止java.exe进程。因此会话被杀死。