sikuli scripts not working on multiple devices

Asked by raghuveer

Hi ,

We have automated few scripts in sikuli for Wince mobile devices.
Its working fine when we run script on one device on which images were taken.
But when we try to run same script on other device it is not detecting images.

This may be due to slight variation in background of UI.
Our intention is to run same script in multiple devices.

Please give some suggestions to overcome this issue.

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
RaiMan (raimund-hocke) said :
#1

take the screenshots (images to search) with as little background as possible ...
... this is the only chance currently

Revision history for this message
raghuveer (raghu-veer) said :
#2

Hi RaiMan,

Thanks for your reply.

Even when we put little background it is failing to detect.

Is there any solution to extract embedded text from image?
If it is there we can try to find image from text in sikuli.
Our intention here is to make generic script which can be able to work
on multiple devices.
If any work around is there please suggest us.

Thanks in advance.

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

Then the only approach is to have different sets for different situations and switch the sets based on an initial check with a few images, that can be used to decide.
Or you have to tell the script somehow (parameter, ini-file, ...) what set to use on the specific run.

--- text:
You might try to use the Region.text() or find(text) feature.
But do not expect too much

Revision history for this message
raghuveer (raghu-veer) said :
#4

Hi RaiMan,

Thanks for your reply.
We will go ahead with the first approach.

Revision history for this message
Boomy Grunt (noneathome) said :
#5

Hi,

I usually lower the similarity of the pattern I'm looking for.
Using the Sikuli IDE:
- click your pattern -> "Pattern Settings" opens
- open the "Mathing Preview" tab
- lower the Similarity at the bottom till it works

Revision history for this message
raghuveer (raghu-veer) said :
#6

Hi Boomy,

Thanks for your reply.

"Matheing Preview" is this similar to Pattern("Start_menu.png").similar(0.5)??

Revision history for this message
Boomy Grunt (noneathome) said :
#7

Uh - a "c" went missing - "Matching Preview" :)

Yes I think it is the same ... I didn't need to make scripts outside the IDE yet.

Don't set it too low or you might get more results than expected. I have a pattern with (imagine my text as picture) "button A | textfield with random text | button B" and a similarity of 0.7 is working nicely to find the combination of button A and B even though the text is always different.