目前,我正试图习惯使用SeLion,并且已经调试了多个问题,并找到了一个我无法逾越的问题。似乎Grid所启动的Selenium版本比POM.xml文件引入的版本低得多。
网格显示:
13:51:21.659 INFO - SeLion Grid version: 2.0.0-SNAPSHOT
Selenium version: 2.53.1, revision: a36b8b1cd5757287168e54b817830adce9b0158d
在POM中,存在3.7.1版的依赖项(我已验证其在项目中显示):
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>3.7.1</version>
</dependency>
当我尝试查找对该版本(2.53.1)的引用时,对其的唯一引用是在我尝试运行该项目时的日志文件中。我原本以为是将runLocally设置为true时从本地安装中提取版本的,但是,我机器上的版本是2.48.0
我还尝试在计算机上升级到2.53.1,以查看是否有帮助,但仍然存在相同的问题。
这是堆栈跟踪:
13:51:22.753 ERROR - org.openqa.selenium.remote.DesiredCapabilities java.lang.ArrayStoreException: org.openqa.selenium.remote.DesiredCapabilities at org.openqa.grid.internal.utils.configuration.GridNodeConfiguration$DefaultDesiredCapabilitiesBuilder.getCapabilities(GridNodeConfiguration.java:133) at org.openqa.grid.internal.utils.configuration.GridNodeConfiguration.(GridNodeConfiguration.java:218) at com.paypal.selion.grid.SeLionGridNodeConfiguration.(SeLionGridNodeConfiguration.java:30) at com.paypal.selion.grid.SeLionGridLauncherV3$1.setConfiguration(SeLionGridLauncherV3.java:148) at com.paypal.selion.grid.SeLionGridLauncherV3.boot(SeLionGridLauncherV3.java:286) at com.paypal.selion.grid.ThreadedLauncher.run(ThreadedLauncher.java:134) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Exception in thread "pool-4-thread-1" java.lang.IllegalStateException: java.lang.ArrayStoreException: org.openqa.selenium.remote.DesiredCapabilities at com.paypal.selion.grid.ThreadedLauncher.run(ThreadedLauncher.java:138) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.ArrayStoreException: org.openqa.selenium.remote.DesiredCapabilities at org.openqa.grid.internal.utils.configuration.GridNodeConfiguration$DefaultDesiredCapabilitiesBuilder.getCapabilities(GridNodeConfiguration.java:133) at org.openqa.grid.internal.utils.configuration.GridNodeConfiguration.(GridNodeConfiguration.java:218) at com.paypal.selion.grid.SeLionGridNodeConfiguration.(SeLionGridNodeConfiguration.java:30) at com.paypal.selion.grid.SeLionGridLauncherV3$1.setConfiguration(SeLionGridLauncherV3.java:148) at com.paypal.selion.grid.SeLionGridLauncherV3.boot(SeLionGridLauncherV3.java:286) at com.paypal.selion.grid.ThreadedLauncher.run(ThreadedLauncher.java:134) ... 3 more 13:52:24.055 ERROR - Failed to start a LocalNode org.openqa.grid.common.exception.GridException: Failed to start a LocalNode at com.paypal.selion.internal.platform.grid.AbstractBaseLocalServerComponent.boot(AbstractBaseLocalServerComponent.java:75) at com.paypal.selion.internal.platform.grid.LocalNode.boot(LocalNode.java:86) at com.paypal.selion.internal.platform.grid.LocalGridManager.spawnLocalHub(LocalGridManager.java:76) at com.paypal.selion.internal.platform.grid.SeleniumGridListener.beforeInvocation(SeleniumGridListener.java:134) at org.testng.internal.invokers.InvokedMethodListenerInvoker$InvokeBeforeInvocationWithoutContextStrategy.callMethod(InvokedMethodListenerInvoker.java:84) at org.testng.internal.invokers.InvokedMethodListenerInvoker.invokeListener(InvokedMethodListenerInvoker.java:62) at org.testng.internal.Invoker.runInvokedMethodListeners(Invoker.java:556) at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:493) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:215) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142) at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:178) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.IllegalStateException: LocalNode can not be contacted. at com.paypal.selion.internal.platform.grid.AbstractBaseLocalServerComponent.waitForComponentToComeUp(AbstractBaseLocalServerComponent.java:171) at com.paypal.selion.internal.platform.grid.AbstractBaseLocalServerComponent.boot(AbstractBaseLocalServerComponent.java:72) ... 14 more
任何人都能提供的帮助将不胜感激。