Developed the automation framework in Appium and I am starting the Appium server programmatically. *Runs fine if,* 1. the Same framework runs locally without Jenkins 2. Configure the Jenkins job by giving the local POM file path and not giving the git repository configured in the Jenkins job.
However, if I configure Jenkins job with Git repository project link and it fails with the below error. *NPM and Appium are already installed.* *Code:* AppiumServiceBuilder builder = new AppiumServiceBuilder(); DesiredCapabilities capability = new DesiredCapabilities(); capability.setCapability("noReset", "false"); //Build the Appium service builder = new AppiumServiceBuilder(); builder.withAppiumJS(new File("C:\\Users\\rajes\\AppData\\Roaming\\npm\\node_modules\\appium\\build\\lib\\main.js")); builder.withIPAddress(AppConstant.appiumServerIP); builder.usingPort(AppConstant.appiumServerPort); builder.withCapabilities(capability); builder.withArgument(GeneralServerFlag.SESSION_OVERRIDE); builder.withArgument(GeneralServerFlag.LOG_LEVEL,"error"); // builder.withLogFile(new File(FrameworkConstant.appiumServerLogPath)); builder.withStartUpTimeOut(FrameworkConstant.AppiumServerTimeout, TimeUnit.SECONDS); *ERROR in Jenkins* io.appium.java_client.service.local.InvalidServerInstanceException: Invalid server instance exception has occured: There is no installed nodes! Please install node via NPM (https://www.npmjs.com/package/appium#using-node-js) or download and install Appium app (http://appium.io/downloads.html) at io.appium.java_client.service.local.AppiumServiceBuilder.findNodeInCurrentFileSystem(AppiumServiceBuilder.java:156) at io.appium.java_client.service.local.AppiumServiceBuilder.checkAppiumJS(AppiumServiceBuilder.java:317) at io.appium.java_client.service.local.AppiumServiceBuilder.createArgs(AppiumServiceBuilder.java:397) at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:338) at io.appium.java_client.service.local.AppiumDriverLocalService.buildService(AppiumDriverLocalService.java:71) at com.appium.AppiumSetup.startAppiumServer(AppiumSetup.java:41) at com.testCases.BaseTest.invokeAppium(BaseTest.java:25) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:133) at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:62) at org.testng.internal.ConfigInvoker.invokeConfigurationMethod(ConfigInvoker.java:385) at org.testng.internal.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:321) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:317) at org.testng.SuiteRunner.run(SuiteRunner.java:276) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1212) at org.testng.TestNG.runSuitesLocally(TestNG.java:1134) at org.testng.TestNG.runSuites(TestNG.java:1063) at org.testng.TestNG.run(TestNG.java:1031) at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:284) at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75) at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:119) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:428) at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:562) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:548) Caused by: java.io.IOException: C:\Windows\system32\config\systemprofile\AppData\Roaming\npm\node_modules at io.appium.java_client.service.local.AppiumServiceBuilder.findNodeInCurrentFileSystem(AppiumServiceBuilder.java:157) ... 29 more -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/5d91be64-7a84-4469-a0de-de28753a670an%40googlegroups.com.