Multiple images of Same Kind- How to Handle with Sikuli

Asked by Bindu

Hi,

I need some help in handling more than one similar image on the screen. Let's say if there is a "Find" more than once on the screen and I intend to click on second Find button; how to handle this situation with sikuli. Please help me out.

Thanks,
Bindu

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

easiest way is to restrict the search region to the area containing the button you want.

example on this web page:

header = find("image of text Question Information.png")
reg = header.below(60).left(1).right(150) # see comment
reg.click("image of yellow edit sys mol.png")

comment: this defines the the area (150 x 60) relatively (below) to a given match.

In the end, it will click the edit button of the Language aspect.

Revision history for this message
Bindu (madhupenugonda-bindu) said :
#2

Thank you so much Raimen, it worked with Sikuli IDE.. now i need to check with eclipse.

yesterday I also tried almost the same code like with out providing left and right function.. how will that effect in selecting the right image. Can you please clarify this doubt as well.

header = find("image of text Question Information.png")
reg = header.below(60
reg.click("image of yellow edit sys mol.png")

I really appreciate your prompt response... really really thank you.

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

my solution restricts the area toa space, that contains exactly only the Language related button. And it defines a width independent of the match header.

Your solution defines an area of height 60 below the match header, but with the width of match header (which makes no difference in this case, since the width of match header should be narrow enough to not include the Status related button.

Can you help with this problem?

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

To post a message you must log in.