← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #180569]: exists and click

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
--- recommendation:

 if v.exists("ga-1.png"):
        click(v.getLastMatch())

so you do not have an additional find operation with the click, since
the exists already found the image and you can now click the match.

--- You say: So it seems that exists() thought the image existed but click() did not think so.
Both functions (exists() and click() ) internally use the same find operation. So if the exists() does not find the picture, the click will not happen at all. If exists finds the picture, the click finds the same picture.
So I am not really sure, what you mean.

background color: you should try, to capture as little as possible of
the background. The less you have in your capture, the more reliable
will your search work in case of slightly changing background.

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