I have an appium project which runs perfectly in local system and jenkins perfectly. All of a sudden in Jenkins it started to throw the below exception
the main Appium script does not exist at ‘C:\WINDOWS\system32\config\systemprofile\AppData\Roaming\npm\node_modules\appium\build\lib\main.js’
Earlier it was fetching automatically from
C:\username\AppData\Roaming\npm\node_modules\appium\build\lib\main.js’
Questions:
-
Why there is a path change occurred? The only change that was done is modified the Jenkins to run as a service
-
Setting the Node path and Appium JS path is not helpful and produced the below mentioned exception.
CODE:
builder
.withAppiumJS(new File(System.getenv("AppData") + "\\npm\\node_modules\\appium\\build\\lib\\main.js"))
.usingDriverExecutable(new File("C:/Program Files/nodejs/node.exe"))
**Exception: ** the local appium server has not been started. The given Node.js executable:
Note:
Local Machine: Win 10
Jenkins Machine: Win 10
Appium java client: 7.3.0
Node latest version installed
Environmental variable path set for node and npm