appium-android - 无法调用 "org.openqa.selenium.os.CommandLine.isRunning()",因为 "this.process"为空

标签 appium-android appium-java

当我执行脚本时,它给我一个错误:无法调用“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了解更多详情。 配置失败:@BeforeClassConfigureAppium 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( native 方法) 在 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.MethodInitationHelper.invokeMethod(MethodInitationHelper.java:133) 在 org.testng.internal.MethodInitationHelper.invokeMethodConsideringTimeout(MethodInitationHelper.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)

最佳答案

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

通过访问$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

关于appium-android - 无法调用 "org.openqa.selenium.os.CommandLine.isRunning()",因为 "this.process"为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75852195/

相关文章:

appium - 语法错误 : Unexpected token 'export'

javascript - 如何在多个设备上并行运行测试?

java - 手机 : Android: How to hit enter after entering a text

java - 实例化对象时出现 Appium 错误

appium - Travis CI - 无法删除端口转发错误执行 adbExec