← Back to team overview

sikuli-driver team mailing list archive

[Question #268573]: Java API - FindFailed: can not find image os second monitor

 

New question #268573 on Sikuli:
https://answers.launchpad.net/sikuli/+question/268573

I'm using Java IDE with Sikuli to detect image on second monitor.  Code works fine on default monitor and in Sikuli IDE, but doesn't  find on second monitor.
Code:
package sikuli;
import org.sikuli.script.*;

public class Sikuli {
    public static void main(String[] args) {
        Screen scr1 = new Screen(1);
        try{
            System.out.println(scr1.getNumberScreens());
            System.out.println(scr1.find("C:\\Sikuli\\Sikuli 1.1.0\\Scripts\\Working.sikuli\\plus.png"));
            scr1.click("C:\\Sikuli\\Sikuli 1.1.0\\Scripts\\Working.sikuli\\plus.png");
        }
        catch(FindFailed e){
            e.printStackTrace();
        }
    }
}

Error:
FindFailed: can not find C:\Sikuli\Sikuli 1.1.0\Scripts\Working.sikuli\plus.png in S(1)[-1280,0 1280x1024]
  Line 2151, in file Region.java

	at org.sikuli.script.Region.handleFindFailedShowDialog(Region.java:2151)
	at org.sikuli.script.Region.handleFindFailed(Region.java:2096)
	at org.sikuli.script.Region.wait(Region.java:2298)
	at org.sikuli.script.Region.find(Region.java:2167)
	at sikuli.Sikuli.main(Sikuli.java:8)
Process exited with exit code 0.

Thanks for yout help.



-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.