Sometimes error Findfailed will be caused during running my script

Asked by Stranger on 2017-12-22

Log as:
FindFailed: x.png: (20x16) seen at (455, 46) with 1.00 in R[31,9 481x392]@S(0) E:Y, T:3.0
  Line 2759, in file Region.java

From log, the screenshot x.png is found with similary score as 1, and I calculate that it is in the range. Why it sometimes report FindFailed?
The function in my script is close the "x" at the up right of window, the size and location of the window is fixed and set to const, repeat to open the window and click "x" to close the window, sometimes this problem will happen(Attention, the "x" is at the border of the window, I am not sure if it will cause FindFailed).

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2017-12-22
Last reply:
2017-12-22
Stranger (peterlee007) said : #1

Attach my script:

from const import const
reg = const.Reg1stIn6
Region(reg).offset(Location(30,-30)).click("x.png")

RaiMan (raimund-hocke) said : #2

The image with all its pixels must completely lie inside the search region.

Errors like this might not be obvious for humans, since we do not take into account, that the image might have an extended background: WE see the key visuals, but SikuliX deals with the whole image with its given width x height.

if only one pixel column or row is outside, the image cannot be found.

The best is to capture with as little surrounding background as possible.

Can you help with this problem?

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

To post a message you must log in.