A page has the same image in multiple areas. How will the script select the right one?

Asked by Ashwin Raju

I've managed to use sikuli to automate a flash player but now I'm wondering how this script will function if two images of the same type lie in different parts of the webpage.

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
Eugene S (shragovich) said :
#1

If you have more than one image that will match your pattern you will need to perform additional steps to ensure you are picking the correct area.

There are many ways how you can solve this problem and it depends on your particular case.

For example:
1. Extract the screen location of all matched regions and pick the correct one.
2. Use another pattern that is located closely to your area of interest as a pivot.
3. You can initially limit the search area, for example to only the left side of the screen.
4. etc..

Cheers,
Eugene

Revision history for this message
Ashwin Raju (ashwin-raju) said :
#2

Hi Eugene,

The 3rd point sounds interesting. Can you show me example or point me to how this can be done?

Revision history for this message
Eugene S (shragovich) said :
#3

Have a look at setROI() methods here:
http://doc.sikuli.org/region.html#Region.setROI

Can you help with this problem?

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

To post a message you must log in.