FindFile: can't be found in Eclipse

Asked by Mario

I am trying the Java example but keep getting the FindFile error. Please see code and error below

import edu.mit.csail.uid.*;

public class Sikuli_Notepad {

        public static void main(String[] args) {
                Screen s = new Screen();
                try{
                        s.click("c:/eclipse/start.png", 0);
                        s.wait("c:/eclipse/start.png");
                        s.click("imgs/Run.png", 0);
                        s.type(null, "key.DELETE", 0);
                        s.type(null, "hello world\n", 0);
                }
                catch(FindFailed e){
                        e.printStackTrace();
                }

        }

}

ScreenMatchProxy loaded.
FindFailed: c:/eclipse/start.png can't be found.
Line ?, in File ?
 at edu.mit.csail.uid.Region.wait(Region.java:240)
 at edu.mit.csail.uid.Region.find(Region.java:186)
 at edu.mit.csail.uid.Region.getLocationFromPSRML(Region.java:567)
 at edu.mit.csail.uid.Region.click(Region.java:297)
 at Sikuli_Notepad.main(Sikuli_Notepad.java:8)

Question information

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

it is not a FileFind problem. You get an exception FindFailed, which means, that the image start.png cannot be found on the screen (it happens in the s.wait() (you can see it in the trace).

Only a guess:
after clicking on the image start.png the screen changes, so that the image start.png is no longer visible (at least as it looked when captured).

Revision history for this message
Mario (mmatthee) said :
#2

Perfect answer.
The solution was to resize Eclipse and then execute the script.