jenkinswdio-v5

do anyone know what this log output mean


i'm trying to run an automated test against the browser with jenkins, i'm using the webdriverIO framework. when i use the command prompt it works but when triggering the job with jekins i get an error which i think is related to the jenkins execute shell feature ,

i've downloaded the nodejs plugin and set jenkins to use the custom workspace : C:/Users/Dell/Desktop/WebDriverio/node_modules/.bin

in the shell command i put :

npm install npm test

like in this wiki : https://wiki.jenkins.io/display/JENKINS/NodeJS+Plugin

in jenkins system configurationi populated the environement variable field with the path to the npm bin file which is in program files

this is the log output:

Running as SYSTEM
Building in workspace C:/Users/Dell/Desktop/WebDriverio/node_modules/.bin
[.bin] $ sh -xe C:\Users\Dell\AppData\Local\Temp\jenkins4703594410706272745.sh
The system cannot find the file specified
FATAL: command execution failed
java.io.IOException: CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(Unknown Source)
    at java.lang.ProcessImpl.start(Unknown Source)
Caused: java.io.IOException: Cannot run program "sh" (in directory "C:\Users\Dell\Desktop\WebDriverio\node_modules\.bin"): CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessBuilder.start(Unknown Source)
    at hudson.Proc$LocalProc.<init>(Proc.java:250)
    at hudson.Proc$LocalProc.<init>(Proc.java:219)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:937)
    at hudson.Launcher$ProcStarter.start(Launcher.java:455)
    at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:109)
    at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
    at hudson.model.Build$BuildExecution.build(Build.java:206)
    at hudson.model.Build$BuildExecution.doRun(Build.java:163)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
    at hudson.model.Run.execute(Run.java:1853)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:427)
Build step 'Execute shell' marked build as failure
Finished: FAILURE

thank you in advance


Solution

  • To run scripts on Windows machines, you need to use Execute Windows batch command instead of Execute shell unless you use Cygwin, which is a different story.

    enter image description here