Finding an image/object inside a captured image

Asked by Varun Gupta on 2017-07-20

I have requirement, to work with tree structure using Sikuli(1.1.0) with Java

On the Application Under Test, we have multiple expand buttons(+) with unique labels.
Using Sikuli I am able to identify the lables along with expand button(+).

As per my requirement I want to click on expand button(+) containing particular label, I tried with following code to find expand button(+) using the image which is captured with label & expand button.

        Settings.MinSimilarity = 0.5;
        int x = s.find("Label1.PNG").getX();
        int y = s.find("Label1.PNG").getY();
        int w = s.find("Label1.PNG").getW();
        int h = s.find("Label1.PNG").getH();
        Region abc = s.setRect(x, y, w, h);"expand.PNG");

While running, I am getting following error:
Exception in thread "main" FindFailed: can not find C:\expand.PNG in S(0)[0,0 1600x900]
  Line 2189, in file

 at org.sikuli.script.Region.handleFindFailedShowDialog(
 at org.sikuli.script.Region.handleFindFailed(
 at org.sikuli.script.Region.wait(
 at org.sikuli.script.Region.find(

Is it possible to find inside object of the image if yes,please share the information?

Question information

English Edit question
Sikuli Edit question
No assignee Edit question
Last query:
Last reply:
RaiMan (raimund-hocke) said : #1

this is the normal way:

Match label = s.find("Label1.PNG");"expand.PNG");

"expand.PNG" is searched in the Region defined by the Match label.

Can you help with this problem?

Provide an answer of your own, or ask Varun Gupta for more information if necessary.

To post a message you must log in.