无法调用“org.openqa.selenium.os.CommandLine.isRunning()”因为“this.process”为空

问题描述 投票:0回答:1

当我执行脚本时,它给我一个错误:无法调用“org.openqa.selenium.os.CommandLine.isRunning()”因为“this.process”为空

[RemoteTestNG] 检测到 TestNG 版本 7.4.0 SLF4J:未找到 SLF4J 提供程序。 SLF4J:默认为无操作 (NOP) 记录器实现 SLF4J:有关详细信息,请参阅https://www.slf4j.org/codes.html#noProviders。 失败的配置:@BeforeClass ConfigureAppium java.lang.NullPointerException:无法调用“org.openqa.selenium.os.CommandLine.isRunning()”,因为“this.process”为空 在 io.appium.java_client.service.local.AppiumDriverLocalService.destroyProcess(AppiumDriverLocalService.java:220) 在 io.appium.java_client.service.local.AppiumDriverLocalService.destroyProcess(AppiumDriverLocalService.java:253) 在 io.appium.java_client.service.local.AppiumDriverLocalService.start(AppiumDriverLocalService.java:176) 在 appiumtest.appium.BaseTest.ConfigureAppium(BaseTest.java:33) 在 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(本机方法) 在 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) 在 java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在 java.base/java.lang.reflect.Method.invoke(Method.java:568) 在 org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:133) 在 org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout (MethodInvocationHelper.java:62) 在 org.testng.internal.ConfigInvoker.invokeConfigurationMethod(ConfigInvoker.java:385) 在 org.testng.internal.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:321) 在 org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:176) 在 org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:122) 在 java.base/java.util.ArrayList.forEach(ArrayList.java:1511) 在 org.testng.TestRunner.privateRun(TestRunner.java:794) 在 org.testng.TestRunner.run(TestRunner.java:596) 在 org.testng.SuiteRunner.runTest(SuiteRunner.java:377) 在 org.testng.SuiteRunner.runSequentially (SuiteRunner.java:371) 在 org.testng.SuiteRunner.privateRun(SuiteRunner.java:332) 在 org.testng.SuiteRunner.run(SuiteRunner.java:276) 在 org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53) 在 org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96) 在 org.testng.TestNG.runSuitesSequentially (TestNG.java:1212) 在 org.testng.TestNG.runSuitesLocally(TestNG.java:1134) 在 org.testng.TestNG.runSuites(TestNG.java:1063) 在 org.testng.TestNG.run(TestNG.java:1031) 在 org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115) 在 org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251) 在 org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)

appium-android appium-java
1个回答
0
投票

以下解决方案解决了我的问题

通过转到

$HOME/.m2/repository/io/appium/java-client/8.3.0
并调整文件解决它:java-client-8.3.0.pom。将所有与 selenium 相关的依赖项的版本标记从:
<version>[4.7.0, 5.0)</version>
更改为
<version>[4.7.0, 4.8.2)</version>
以消除不兼容的 4.8.2 selenium 版本。

原帖:https://github.com/appium/java-client/issues/1872#issuecomment-1484017595

© www.soinside.com 2019 - 2024. All rights reserved.