I am having an issue trying to find an image on the screen, I tried doing it in two different ways and it doesn't seem to work for me. I am trying to do this with Appium running on IOS simulator which shows up on the screen, so I don't see this being a problem of a screenshot being taken.
I am running MAC OSX El Capitan I have imported the Sikuli X java API in my project
Do I need to also import the MAC Sikuli Library jar?
This is what I have tried so far:
1.
Screen s = new Screen();
Pattern test = new Pattern("/Users/ealiaj/Desktop/Automation/workspace/WheelsUp - IOS/screenshot.jpg");
try {
s.find(test);
} catch (FindFailed e) {
}
2.
Screen s = new Screen();
try {
s.find("screenshot.jpg");
} catch (FindFailed e) {
}
I keep getting cannot find errors.
error message:
FindFailed: can not find /Users/ealiaj/Desktop/Automation/workspace/WheelsUp - IOS/screenshot1.jpg in S(0)[0,0 1440x900] Line 2189, in file Region.java
This is the image on the screen, The large red rectangle is the image I have created a screenshot for and try to find, but get that error.
The only thing I am able to successfully find is that gray rectangle, or at least it doesn't throw an error for.