Unable to start appium through jenkins for desktop application

Hello ,
I’m new in appium test. i created maven project and when i run my test with junit or maven , using commands to launch winapp driver, it works fine.
Now i run my job in jekins slave , but it can’t open winappdriver ( error 500) using the commands . The commands are :
String command= “c\program files\windows application driver\WinnAppdriver.exe”;
ProcessBuilder builder = new ProcessBuilder (command);
p =builder.start()
although it works fine when i manually open winappdriver and i launch my job.
Do you have any idea please about how can i resolve this probleme ?
Thanks for your help

All magic is how you launch your job in jenkins. In many cases you need to provide PATH to job.
When you start manually you do it in windows command prompt under your user. Jenkins may start job under another user and does not see environment variables (where is Java and so on)

Thanks for your response :slight_smile: i tried to inject the variables to my job
image
when i verify http://localhose:8080/job/Test/56/injectedEnvVars/ , i find all my variables env but the job still not working .
i have ERROR! java.lang.NullPointerException and {“status”:13,“value”:{“error”:“unknown error”,“message”:"Failed to locate opened application window with appId

no.

  1. in command prompt on same computer where tests are running execute:
echo $PATH
  1. in jenkins add above output and it should look similar to ->
  2. run again and if error met read what exactly not found -> where is it -> add to jenkins path

Hello Aleksei,
I did exactly what you told me . I still have error :confused: . i think that the script open the winappdriver and close it


and when it try to open the application :

enable debug logs in appium server. we will see more info what happens.