Help finding image in Java

Asked by Elsid

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) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  }

I get an error about a mouse pointer:

[error] RobotDesktop: checkMousePosition: should be L(720,450)@S(0)[0,0 1440x900]
but after move is L(558,366)@S(0)[0,0 1440x900]
Possible cause in case you did not touch the mouse while script was running:
 Mouse actions are blocked generally or by the frontmost application.

2.

Screen s = new Screen();
    try {
   s.find("screenshot.jpg");
  } catch (FindFailed e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  }

I keep getting cannot find errors.

Thanks.

Question information

Language:
English Edit question
Status:
Expired
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Elsid (elsidaliaj) said :
#2

Still need help

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

--- using 1.1.0 final?

--- did you run a successful setup?

--- What is your Java IDE?

Revision history for this message
Elsid (elsidaliaj) said :
#4

Yes
Yes logs show successful setup
I am using Eclipse

Revision history for this message
Elsid (elsidaliaj) said :
#5

Information added, you can also see my question at stackoverflow for more info, http://stackoverflow.com/questions/31839136/sikuli-is-not-finding-image-files.

Revision history for this message
Elsid (elsidaliaj) said :
#6

As mentioned in the stack overflow question, I am able to find a tiny gray rectangle, but if I take screenshots of anything else like the button, it doesn't find it.

Revision history for this message
Launchpad Janitor (janitor) said :
#7

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Elsid (elsidaliaj) said :
#8

I still need an answer, anybody?

Revision history for this message
Launchpad Janitor (janitor) said :
#9

This question was expired because it remained in the 'Open' state without activity for the last 15 days.