← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #215645]: Ifexists() & finder() function arent working as expected

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
-- if exists("AueIV1ExtGnI.png"):
If it is so, that always the +ve part (Sikuli tries to click() and might fail) is processed, then it simply means, that in all cases the image AueIV1ExtGnI.png is found somewhere on the screen with a similarity score of more than 0.7

You might try to optimize the screenshot, to make the visual object more
distinguishable or you might try to raise the minimum similarity to a
value of 0.9 or even higher (IDE Preview).

to test it:

if exists(Pattern"AueIV1ExtGnI.png".similar(0.9)):
    getLastMatch().highlight(2) # to see what is found and how
    click("1353997241258.png")
else:
    print "Its wrong"

--- correct usage of Finder (see docs: doc.sikuli.org)

f=Finder("AueIV1ExtGnI.png")
img="ExGnIodPnsen.png"
f.find(img)
if f.hasNext():

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