Cannot invoke "org.openqa.selenium.os.CommandLine.isRunning()" because "this.process" is null

[RemoteTestNG] detected TestNG version 6.14.3

[TestNGContentHandler] [WARN] It is strongly recommended to add “” at the top of your file, otherwise TestNG may fail or not work as expected.

SLF4J: No SLF4J providers were found.

SLF4J: Defaulting to no-operation (NOP) logger implementation

SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.

FAILED CONFIGURATION: @BeforeClass ConfigureAppium

java.lang.NullPointerException: Cannot invoke “org.openqa.selenium.os.CommandLine.isRunning()” because “this.process” is null

at io.appium.java_client.service.local.AppiumDriverLocalService.destroyProcess(AppiumDriverLocalService.java:220)

at io.appium.java_client.service.local.AppiumDriverLocalService.destroyProcess(AppiumDriverLocalService.java:253)

at io.appium.java_client.service.local.AppiumDriverLocalService.start(AppiumDriverLocalService.java:176)

at RahulAutomation.Appium.BaseTest.ConfigureAppium(BaseTest.java:46)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.base/java.lang.reflect.Method.invoke(Method.java:568)

at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)

at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:59)

at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:458)

at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:222)

at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)

at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:168)

at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)

at org.testng.TestRunner.privateRun(TestRunner.java:648)

at org.testng.TestRunner.run(TestRunner.java:505)

at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)

at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)

at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)

at org.testng.SuiteRunner.run(SuiteRunner.java:364)

at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)

at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)

at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)

at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)

at org.testng.TestNG.runSuites(TestNG.java:1049)

at org.testng.TestNG.run(TestNG.java:1017)

at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)

at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)

at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)

SKIPPED CONFIGURATION: @AfterClass tearDown

SKIPPED: HybridApp

java.lang.NullPointerException: Cannot invoke “org.openqa.selenium.os.CommandLine.isRunning()” because “this.process” is null

at io.appium.java_client.service.local.AppiumDriverLocalService.destroyProcess(AppiumDriverLocalService.java:220)

at io.appium.java_client.service.local.AppiumDriverLocalService.destroyProcess(AppiumDriverLocalService.java:253)

at io.appium.java_client.service.local.AppiumDriverLocalService.start(AppiumDriverLocalService.java:176)

at RahulAutomation.Appium.BaseTest.ConfigureAppium(BaseTest.java:46)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.base/java.lang.reflect.Method.invoke(Method.java:568)

at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)

at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:59)

at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:458)

at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:222)

at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)

at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:168)

at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)

at org.testng.TestRunner.privateRun(TestRunner.java:648)

at org.testng.TestRunner.run(TestRunner.java:505)

at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)

at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)

at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)

at org.testng.SuiteRunner.run(SuiteRunner.java:364)

at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)

at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)

at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)

at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)

at org.testng.TestNG.runSuites(TestNG.java:1049)

at org.testng.TestNG.run(TestNG.java:1017)

at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)

at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)

at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)

===============================================

Default test

Tests run: 1, Failures: 0, Skips: 1

Configuration Failures: 1, Skips: 1

===============================================

===============================================

Default suite

Total tests run: 1, Failures: 0, Skips: 1

Configuration Failures: 1, Skips: 1

===============================================

Faced with the same issue.
node 19.8.1

1 Like

Faced with the same issue.

@rahul_vakhariya is this resolved?

I Too have same issue

which java-client version do you use?

I got this issue on latest java-client (8.3.0)

ok, great.
Do you know to tell which selenium-api version you use?
look at the jar file selenium-api-4.8.2.jar or similar…
If you use selenium 4.8.2 or above then, please checkout my workaround here(you can try it anyway if you want, assuming you use maven): https://github.com/appium/java-client/issues/1872#issuecomment-1484017595

If you will find it beneficial please write here so others will know as well.

I have the same issue and I can not just use the workaround posted by @ido_oserovitz since this is failing in our Azure pipelines as well. Any other suggestion around this issue? Im using java-client 8.3.0 and the selenium version that java-client 8.3.0 uses which is probably 4.8.2 or above.

We manage our pipelines using Jenkins and running the tests on a remote VM. I connected to the machine and the workaround solved it. If you have a similar situation and you can connect to the machine which you run your tests on, it should work as well.

Hopefully this will fix the issue https://github.com/appium/java-client/issues/1872#issuecomment-1484017595

Below solution solved my problem
Solved it by going to $HOME/.m2/repository/io/appium/java-client/8.3.0 and adjusting the file: java-client-8.3.0.pom . Changing all selenium related dependencies’ version tag from: <version>[4.7.0, 5.0)</version> to <version>[4.7.0, 4.8.2)</version> to eliminate incompatible 4.8.2 selenium version.

orignal post- https://github.com/appium/java-client/issues/1872

thanks @ido_oserovitz

1 Like

Below solution solved my problem
Solved it by going to $HOME/.m2/repository/io/appium/java-client/8.3.0 and adjusting the file: java-client-8.3.0.pom . Changing all selenium related dependencies’ version tag from: <version>[4.7.0, 5.0)</version> to <version>[4.7.0, 4.8.2)</version> to eliminate incompatible 4.8.2 selenium version.

orignal post- https://github.com/appium/java-client/issues/1872

I faced same issue even i set all configuration proper and also add .m2 repository but now i have solved this issue by adding following lines of code if you still facing issue after set configuration also then just add below one line of code in AppiumServiceBuilder:

.usingDriverExecutable (new File (“C:\Program Files (x86)\nodejs\node.exe”));

1 Like

Thanks @kamna_Rai. Your solution worked for me.