Image find fails when searching more than one time the same image --- workaround see comment #4 and #5

Asked by Jesús Ferrandis Torrón

I use SikuliX 2.0.6.

When I use SCREEN.click(Pattern("imagename").targetOffset(0,70)) two times in the same script, the second time there is a FindFailed error (FindFailed: in R[0,0 1920x1080]@S(0) with I[imagename.png(73x32)] at(1751,982)%94.22 Line 904, in file Element.java).

Between the two clicks the image changes its position and with the SikuliX GUI both positions give more than 90% of recognition.

The error message gives the impression that it stores the first position and percentage (94.22%) and it searches in the same place the second time which would explain why it does not find it. But from what I've read it should not do this and so there is no way to prevent it from doing it.

Do someone see what could be the problem here?

Thank you in advance.

Question information

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

I will check

Revision history for this message
RaiMan (raimund-hocke) said :
#2

I am sorry, but I cannot reproduce your situation.
It is true, that in the standard (Settings.CheckLastSeen = True) the image is searched, where it was seen the last time, but if it is not found there with the last similarity, then it is searched again normally in the given region).

To help you further, I need the 2 screenshots showing the image in the 2 different locations and the relevant part of your script.
send to sikulix---at---outlook---dot---com

plus info about your system and Java version.

Revision history for this message
Jesús Ferrandis Torrón (trjeft) said :
#3

I have sent you an email. Thank you for your time. :)

Revision history for this message
RaiMan (raimund-hocke) said :
#4

Got the stuff.

I suppose, that the image "Radiance.Administration.Language" is a shot of the drop-down-label "User Language:".

You might try with switched off image caching (an image is always loaded from the image file):
Settings.setImageCache(0)
... as early as possible after script start.

Meanwhile you might as well try with the version 2.0.5 (if you like).

Meanwhile I have to replicate your implementation using Python-classes and do some tests.

Revision history for this message
Jesús Ferrandis Torrón (trjeft) said :
#5

Thank you so much, Settings.setImageCache(0) solved the issue.
Please keep me update with any progression you do with this, I will be glad to help you and give you more info if you need it.
Have a good day!

Revision history for this message
RaiMan (raimund-hocke) said :
#6

Thanks for the feedback.

I set it to answered, to keep it open for me.
No further action needed from your side.

I will post here, if I find the final solution.

Can you help with this problem?

Provide an answer of your own, or ask Jesús Ferrandis Torrón for more information if necessary.

To post a message you must log in.