4
votes

I have a maven project setup to run my JUnit tests. I am utilizing Sikuli to click on certain images on the screen. When executing my test using the "mvn test" command in a terminal or through Eclipse it will work.

I now have to integrate these tests in Jenkins which I assumed would be straight forward; however, this is not the case. After creating a job in Jenkins I executed the "mvn test" command to run my tests and maven does run the test but the test will always fail because Sikuli cannot find the image on the screen. The Sikuli error message is

\Jenkins\workspace\Smoke_Test_Suite\Console\src\main\java\resources\main-widget\calc.PNG: (229x325) in R[0,0 1024x768]@S(0)

Has anyone ran into this issue with Sikuli and Jenkins. If so, how can one resolve this problem?

1
Keep in mind that Sikuli will not work in "headless" mode. It needs a physical screen attached.Eugene S
I am running Jenkins on the same PC / screen that Sikuli is being run on. If that is what you mean.user7548672
And do you still have the area that you are trying to automate on top of the other windows and applications so that Sikuli can "see" it?Eugene S
Once I select "build now" in Jenkins I minimize everything on the screen except the image that I want to click on but no luck. If I perform this same exact method through either Eclipse or command prompt it works.user7548672
I am receiving this as an error: [error] ImagePath: find: not there: calc.PNG FindFailed: calc.PNG not loadeduser7548672

1 Answers

1
votes

It seems that the image file cannot be found rather than the pattern itself on the screen. It is likely to be some difference in the the environment variables configuration and when running through Jenkins/Maven, the paths are incorrect. To debug this issue to get a better understanding what is actually configured, try to add the following line to your code and run it using Jenkins again:

System.out.println(getBundlePath());

This will print out the currently configured path to where Sikuli looks for image files. I assume it looks for the files in the incorrect location. To set the path to the correct location. you can do:

ImagePath.setBundlePath(correctPath);