1

我正在通过 selenium 网格运行 selenium 测试,但是当它执行tearDownAfterClass()方法时,会出现此问题:

com.thoughtworks.selenium.SeleniumException: Internal Server Error
    at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:112)
    at com.thoughtworks.selenium.HttpCommandProcessor.getCommandResponseAsString(HttpCommandProcessor.java:183)
    at com.thoughtworks.selenium.HttpCommandProcessor.executeCommandOnServlet(HttpCommandProcessor.java:118)
    at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:101)
    at com.thoughtworks.selenium.HttpCommandProcessor.stop(HttpCommandProcessor.java:265)
    at com.thoughtworks.selenium.DefaultSelenium.stop(DefaultSelenium.java:139)
    at com.thoughtworks.selenium.grid.tools.ThreadSafeSeleniumSessionStorage.closeSeleniumSession(ThreadSafeSeleniumSessionStorage.java:33)
    at com.icil.at.as.testtool.Suppliernamelookupv03Test.tearDownAfterClass(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:76)
    at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:525)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:202)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:130)
    at org.testng.internal.TestMethodWorker.invokeAfterClassMethods(TestMethodWorker.java:222)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
    at org.testng.TestRunner.runWorkers(TestRunner.java:1147)
    at org.testng.TestRunner.privateRun(TestRunner.java:749)
    at org.testng.TestRunner.run(TestRunner.java:600)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:317)
    at org.testng.SuiteRunner.access$000(SuiteRunner.java:34)
    at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:351)
    at org.testng.internal.thread.ThreadUtil$CountDownLatchedRunnable.run(ThreadUtil.java:147)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:636)

在我的测试脚本中,这个方法是这样的:

    @AfterClass
public static void tearDownAfterClass() throws Exception {
    closeSeleniumSession();
}

有人建议使用 selenium.cloce() 并且这个错误消失了。但在我的脚本中,它使用 Selenium 网格。在我的脚本中,只有一种方法失败了,其他方法都成功了。

有人可以帮我检查一下并告诉我它有什么问题吗?

4

0 回答 0