← Back to team overview

sikuli-driver team mailing list archive

[Question #239439]: Sikuli - Java Api - find not working using images

 

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

I am using sikuli java api. I have captured the images using sikuli ide and now i want to use them in my java code. 

My code

 final App app = new App("firefox");
 app.open();
 final Screen screen = new Screen();
 screen.type(sikuli.getPattern(imageResourcePath+ "email.png"), "test");
 screen.click(sikuli.getPattern(imageResourcePath + "button.png"));


 public Pattern getPattern(final String fileName) throws IOException {
        final BufferedImage image = ImageIO.read(ResourceUtils.getFile(fileName));
        return new Pattern(image);
    }

The code above doesnt work. I cant see any text typed nor the button is clicked.

The same images work in sikuli ide but dont work here, i get exception 

     FindFailed: can not find P(-- BufferedImage --) S: 0.7 on the screen.
     Line 1574, in file Region.java 

Pretty sure images are on the screen.

Can you please help

Thanks


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