← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #695754]: FindBest(); return if image is not found on Disk or on Screen

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
ok, understood.

... but:
image-not-on-disk is a pre-find condition. this check is currently only available with the single find ops (find, wait, ...) as handleImageMissing feature.
I will add this for the multi-find features, but only later in version 2.0.6 

image-not-found-on-screen is a post-find condition. for the single find ops we have the FindFailed and handleFindFailed features.
with the multi-find features this has to be checked with the returned matches.
For findBest: if nothing is found, then you have a FindFailed-for-all-givenImages, which has to be handled (you have it in your script)

So IMHO only the pre-find condition is problematic for you in the
moment.

a workaround is possible with the preparation of the name[] list you give to findBest().
Instead of just giving the filename to findBest() use 
someImage = Image.create(filename) 
for every name and test 
someImage.isValid()
for True/False

False means, that the image is not on disk or not useable.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.