how to wait for a image but just ignore the part of it

Asked by sangzh

I want to check an image which with many UI items, they will occur with a fixed layout, some items are changeless, but other may change, such as input box, the input value will change, but i do not care for it. i just want to check the big image and ignore the input box's value. how can i do it? thank you!

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

Currently this is only possible, by dividing the image into the parts that do not change and use the 2 or 3 most significant parts like this:

if exists("part1.png") and exists("part2.png", 0) and exists("part3.png", 0):
    print "found"
else:
    print "not found"

part1 is the part, that signals the possibility of appearance (a wait time can be added like with wait()) and part2 and part3 are used to verify that (only one search each).

The stuff can be optimized by using restricted search regions together with nearby(), right(), below(), ...

Revision history for this message
sangzh (sangzhenhua) said :
#2

Thanks RaiMan, that solved my question.