← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #197639]: Suggestions for scaling problems

 

Question #197639 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/197639

    Status: Open => Answered

RaiMan proposed the following answer:
Hi again ;-)

The general solution for such scenarios (independently from the fact,
that we are talking about Sikuli features and the restrictions on using
the same image on different systems/solutions/renderings/...), is to
hide the complexity behind some higher order functions, that make up a
usage oriented functional meta layer.

so e.g. you might say

nxClick(someButton)

and all the problems you are talking about are handled inside the function nxClick().
And talking about Sikuli now: yes, all the stuff has to be setup and handled inside nxClick, which might get rather complex, but on the meta layer you have a clean interface, that just reflects the Netflix GUI independently from such technical aspects like resolution. 

But there is another possible approach, that might reduce the effort somehow:
As far as I understand: the Netflix GUI is rather fixed in its layout.

So lets take the control bar from above as example:
If you now the top left corner of it (topLeft = Location(you-know-it)), then you know for the given resolution:
button1 = topleft.offset(30, 16)
button2 = topleft.offset(80, 16)
button3 = topleft.offset(130, 16)
button4 = topleft.offset(180, 16)

So you have reduced your "different resolution problem" to one image, the rest is found by calculating offsets (that might be dependent of resolution).
This is a general approach that I use in my scripts whenever possible.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.