← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #232177]: Region.exists(img) collects items outside Region

 

Question #232177 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/232177

    Status: Open => Solved

RaiMan changed the question status:
each action, that has to be a region-restricted search, needs the
qualifier region. , otherwise it searches the whole screen.

click(image) internally is split internally into (virtually spoken)
m = region.find(image)
click(m)

with region being SCREEN (constant object for Screen(0)), if not
specified

this case should be written this way, to save the repeated search:
    if Reps.exists("1373032124430.png",2):
       Reps.click(getLastMatch());wait(3)

With 1.0.0, the usage is far easier though:
    if Reps.exists("1373032124430.png",2):
       Reps.click();wait(3)

click() clicks the last match with this region or of SCREEN if not
given.

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