identifing one between 2 namesake buttons

Asked by Kavitha Bhaskaran

I have identical buttons on the same page and I want Sikuli to click only one of those but it ends up clicking the other name sake button. Unfortunately, the button names cannot be changed. Any suggestions on how I could handle this situation?

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

- take care, that the button shot has as little background as possible (just around the button borders)
- with version 1.0.1: use Pattern("button-image.png").exact() (with RC3: Pattern("button-image.png").similar(0.99))

In any case this always helps to speed up things and make them more robust against false positives:
evaluate and use a search region that is as small as possible

... but in most cases already the usage of Pattern().exact() together with "good" shots is sufficient (you might use the Preview window to adjust wanted min similarity)

Can you help with this problem?

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

To post a message you must log in.