I was able to start the appium server programmatically earlier but suddenly I am not able to do so. The error is shown as:
java.lang.NullPointerException
at java.base/java.io.FileOutputStream.(FileOutputStream.java:227)
at java.base/java.io.FileOutputStream.(FileOutputStream.java:185)
at org.openqa.selenium.remote.service.DriverService$Builder.getLogOutput(DriverService.java:448)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:495)
at io.appium.java_client.service.local.AppiumDriverLocalService.buildService(AppiumDriverLocalService.java:92)
at AppiumPractice.iOSBaseClass.configureAppium(iOSBaseClass.java:33)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:578)
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 com.intellij.rt.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:66)
at com.intellij.rt.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:105)
The serviceBuilder code that I wrote is like this:
serviceBuilder = AppiumDriverLocalService.buildService(new AppiumServiceBuilder().usingDriverExecutable(new File("//usr//local//bin//node")).withAppiumJS(new File("//Users//manikantpottumurty//.nvm//versions//node//v20.5.0//lib//node_modules//appium//build//lib//main.js")).withIPAddress(“127.0.0.1”).usingPort(4723));
And I tried it like this also:
serviceBuilder = new AppiumServiceBuilder().usingDriverExecutable(new File("//usr//local//bin//node")).withAppiumJS(new File("//Users//manikantpottumurty//.nvm//versions//node//v20.5.0//lib//node_modules//appium//build//lib//main.js")).withIPAddress(“127.0.0.1”).usingPort(4723).build();
Please help!!