Error in while not found loop. picture not found?

Asked by Sier

Hi there,

i have some problems, getting started with this program.
So i tried a videotutorial from http://groups.csail.mit.edu/uid/sikuli/demo.shtml
called "Checking new status messages on Facebook".

So i used the same code as shown in the Video

while not find(Picture):
 sleep(1)
 click(refresh)

click(Home)
popup ("blabla")

Everythink works finde, if the picture is there.
But if the picture isn't available, i only receive an errormessage.

edu.mit.csail.uid.FindFailed: FindFailed: 1283418523687.png can't be found.
  Line 6, in file C:\DOKUME~1\XX\LOKALE~1\Temp\sikuli-tmp2667211720732785300.py

When the picture is shown on an page, the browser goes to home. :-|

Maybe there some problems with Windows XP?
Also the exit function isn't working. :-|

=========== =========== =========== ===========
Hm... I could fix it by repleacing find thru exists.
But I still can't understand why this isn't working for me. :(

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

The demo videos (as far as I can see) are based on the version 0.9. With the current version 0.10 some basic concepts have changed including the handling of exception FindFailed (raised if an image cannot be found on the screen).

To handle things like your "wait for an image loop" easy, we now. have exists(). in my answer at https://answers.launchpad.net/sikuli/+question/123366 you can reed more about the why's and how's.

If you are really interested in using Sikuli, its highly recommended to have a look at least at the intro chapters of the complete guide: http://sikuli.org/trac/wiki/reference-0.10

Revision history for this message
Sier (sier) said :
#2

Thanks RaiMan, that solved my question.