← Back to team overview

sikuli-driver team mailing list archive

[Question #169247]: wait for image returns traceback if image doesn't exist

 

New question #169247 on Sikuli:
https://answers.launchpad.net/sikuli/+question/169247

findSomething = wait(<image_screenshot> ,10)
if (findSomething):
	popup("foundddddddd")
else:
	popup("nada")


I am using the wait(image,timeout) to find whether an image exists in a given page. The script works if it can find the image, however, if the image doesn't exist I get the following error:

at org.sikuli.script.Region.handleFindFailed(Region.java:349)  at org.sikuli.script.Region.wait(Region.java:420)  at org.python.proxies.sikuli.Region$Region$1.super__wait(Unknown Source)  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)  at java.lang.reflect.Method.invoke(Method.java:597)  org.sikuli.script.FindFailed: FindFailed: can not find ADDTDCA 
RT.png  Line 11, in file /var/folders/g-/g-hNmzJpFWSChvku0F+At++++TI/-Tmp-/sikuli-tmp3219797919268607850.py 



Any idea what might be happening here and how to fix it?
I need it to display "nada" if the image doesn't exist.


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