Region thumbnail gets changed after reopening script

Asked by Ramona Suciu

Hi,

I am trying to find an element inside a region, something like this:
Region(30,879,129,79).inside().find("picture.png"), where Region(30,879,129,79) is an actual thumbnail of the application I am testing.

After reopening the script, the thumbnail of Region(30,879,129,79) does not show my application anymore, but instead it appears to be showing my entire desktop.

Will my script work correctly after re-opening it? Is it in fact the same region, but the Sikuli IDE fails to show it correctly?

Thank you,
Ramona

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

Yes the Region definition is still the same (just hover over the thumbnail). The thumbnail is created at script loading time.

If you do not like the thumbnail, but want to see your definition, the use this trick:

Region(0+30,879,129,79)

which will hide it from the regular expression search.

BTW: have a look at the App class, to find out, how to get the region of the app window dynamically.

One more thing:

Region(30,879,129,79).inside().find("picture.png")

and

Region(30,879,129,79).find("picture.png")

are exactly the same (inside() is some backward compatibility history)

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

To prevent misunderstandings:

Region(30,879,129,79)

is a fixed area relative to the screen. To use it in the script successfully, the underlying app has to open in the same place every time.

Revision history for this message
Ramona Suciu (ramona-suciu) said :
#3

Thanks RaiMan, that solved my question.

Revision history for this message
Ramona Suciu (ramona-suciu) said :
#4

Thanks again, now it's clear and the script is working :)