Image is no longer found after 1k+ usages/runs

Asked by Brokn Dodge

I have noticed after some extensive usage that Sikuli can run flawlessly for 1k or more runs. However, if, at any point, Sikuli mis-clicks an image then it will never be able to correctly identify that image again. I will have to take a new screenshot of that image to replace the one that worked fine for 1k or more runs.

So, I'm wondering if there is some kind of a cache somewhere that either Sikuli or Jython is using that stores some kind of information about the region or the image that can be cleared programmatically.

The alternative would be that the image file is somehow becoming corrupted. If that is the case then I'll file a bug report.

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

No, there is not any magic, that might change a captured image's content automagically.
And currently there is no cache, that might hold images and anyhow not over subsequent script runs or IDE sessions.

So if an image is no longer found though one thinks it should, it always has something to do with the fact, that the screen content has changed against the time, the image was captured (though this might not be obvious to the human looking at the screen).

If for example the background colour changes slightly and the captured image has much background, then this might lead to a reduced similarity score, that might lead to FindFailed (score < wanted score or 0.7 in the standard).

Another reason is rendering: If the rendering scheme changes (might be e.g. with browsers based on different engines), then the image might have different pixels usually at the edges of image elements, which in turn will lead to a reduced similarity.

*** Conclusion:
If an image is no longer found, though it should be found, then you first should check, what has changed in the environment, that is responsible for bringing the grafics on the screen.
You might compare the two images (old and new capture) in an image viewer, that allows to magnify to the pixel level.

Can you help with this problem?

Provide an answer of your own, or ask Brokn Dodge for more information if necessary.

To post a message you must log in.