0

I have two similar images, one image is on the left and one is on the right hand side of the screen. I want to click on the image on the left.

My idea in the code is to create a region for the image on the left then click the image on that region but when I run a code I get the following exception: image to search (650, 330) is larger than image to search in (1, 1).


Region region = new Region(650,330,0,0); 
Pattern element = region.find("myimage.png");
Screen screen = element.getScreen();
screen.doubleClick();

So how can I uniquely identify the image on the left using sikuli? I'm using sikuli version 2.0.5

rich25
  • 37
  • 11

1 Answers1

1

A Region is defined: new Region(x, y, w, h)

Your Region is at (650, 330) with width/height 0 (which internally is 1 pixel).

Region region = new Region(0, 0, 650,330); 
Match match = region.find("myimage.png");
match.doubleClick();

RaiMan from SikuliX

RaiMan
  • 1,088
  • 8
  • 13
  • So in Sikuli what does this message or exception mean: "image to search (650, 330) is larger than image to search in (1, 1).?" – rich25 Mar 09 '22 at 15:41
  • What it says: the Region has one Pixel, whereas the given image surely has some hundred pixels. – RaiMan Mar 10 '22 at 16:24