How to get a Jenkins job working, that uses Sikuli features

Asked by anjan

*************** solution (from comment #3)

1.In my local system installed Jenkins 2.71 version, created one jenkins slave for the local system and launched it.
2.Created one jenkins job and restricted the job for the above created slave.
3. Gave .bat file location in the build step. (windows PC)
4. Script got executed.

-----------------------------------------------------------------------

I was able to run sikuli script from command line with the following command
"C:\Program Files\Java\jre7\bin\java" -jar "D:\sikuli_folder\sikulix.jar" -r "C:\Users\akatrapati\Desktop\ex.sikuli"
but when I save this command in bat file and try to run .bat file in jenkins I am getting following error

C:\Program Files (x86)\Jenkins\jobs\convert123\workspace>"C:\Program Files (x86)\Jenkins\jre\bin\java" -jar "D:\sikuli_folder\sikulix.jar" -r "C:\Users\akatrapati\Desktop\ex.sikuli"
[error] Location: outside any screen (16761144, 16761144) - subsequent actions might not work as expected
[error] Location: outside any screen (16761144, 16761144) - subsequent actions might not work as expected
Program started
[error] script [ C:\Users\akatrapati\Desktop\ex.sikuli ] stopped with error in line 4
[error] FindFailed ( can not find 1470117814180.png in R[0,0 1024x768]@S(0) )
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE

Can anyone help me in solving this problem. Jenkins version is 1.625.2

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
anjan (anjankumar) said :
#1

When I download jenkins.war file and run it in command prompt like java -jar jenkins.war , Jenkins is started and when I try to execute the same .bat file as specified above my sikuli script is running.

Can I know the difference.

Revision history for this message
Best RaiMan (raimund-hocke) said :
#2

When something is run in a Jenkins context, it usually does not have access to a real screen.

But to use the SikuliX features, your runtime environment must have access to a real screen.

Watch out in the net (especially stackoverflow) for solutions with Jenkins, to create an environment, that is accepted by Java as not being headless.

Revision history for this message
anjan (anjankumar) said :
#3

Thanks RaiMan problem solved. I debugged the issue as per your suggestions and approach is below:-

1.In my local system installed Jenkins 2.71 version, created one jenkins slave for the local system and launched it.
2.Created one jenkins job and restricted the job for the above created slave.
3. Gave .bat file location in the build step. (windows PC)
4. Script got executed.

Revision history for this message
anjan (anjankumar) said :
#4

Thanks RaiMan, that solved my question.