FindFailed why?

Asked by Varnostnik on 2018-05-06

Im trying to do something really simple here.

I though this reads like

1. if picture exist, click it, if not go to line 2
2. wait 10 seconds
3. if picture exist, click it, if not go to line 4
4. wait 4 seconds.
and so on.

But I get wired find failed errors all the time. Clear sold and relist are dynamic pictures, meaning they dont always show up.

The script works fine if all picture show up, but fails as soon as line 5 and 7 pictures are missing.

[error] RobotDesktop: checkMousePosition: should be L(715,74)@S(0)[0,0 1920x1080] but after move is L(716,73)@S(0)[0,0 1920x1080] Possible cause in case you did not touch the mouse while script was running: Mouse actions are blocked generally or by the frontmost application. You might try to run the SikuliX stuff as admin.

[log] CLICK on L(715,74)@S(0)[0,0 1920x1080] (535 msec)

[log] CLICK on L(1282,741)@S(0)[0,0 1920x1080] (532 msec)

[error] script [ webapp_relist_all_v2 ] stopped with error at line --unknown--
[error] Error caused by: Traceback (most recent call last): File "F:\scripts\webapp_relist_all_v2.sikuli\", line 5, in <module> exists,click("1525601189398.png") Line 2782, in file
at org.sikuli.script.Region.wait(
at org.sikuli.script.Region.find(
at org.sikuli.script.Region.getLocationFromTarget(
at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
org.sikuli.script.FindFailed: FindFailed: 1525601189398.png: (78x37) seen at (1539, 197) with 1.00 in S(0)[0,0 1920x1080] E:Y, T:3.0 Line 2782, in file

Question information

English Edit question
Sikuli Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Best RaiMan (raimund-hocke) said : #1

Where did you get the info, that
is a correct syntax?

IMHO it should read:
if exists(image): click()

see the docs.

RaiMan (raimund-hocke) said : #2

the magic behind:


defines a list with 2 elements (the function object exists (does nothing) and the result of the function call click(image))

since only the second list element does something, the line works, if the image exists, but fails if not.

since the list is not assigned, it is simply lost, when the next line is executed.

Varnostnik (sawyerbox) said : #3

thank you.
This works much better. :D

Varnostnik (sawyerbox) said : #4

Thanks RaiMan, that solved my question.