RaiMan / SikuliX1

SikuliX version 2.0.0+ (2019+)
https://sikulix.github.io
MIT License
2.7k stars 347 forks source link

App-feature: set position of a window, change its size #302

Open LisBerndt opened 4 years ago

LisBerndt commented 4 years ago

implementation suggestion

In our framework we use AutoIt to focus, position and send keys to an app-window.

I just recognized the app-feature in Sikulix and I successfully tried to focus and send keys to window.

Are there ambitions to realize a positioning function to focus a window to defined coordinates (or is there already one I missed)? This would allow us to substitute AutoIt by Sikulix in long-term.

balmma commented 4 years ago

Are there ambitions to realize a positioning function to focus a window to defined coordinates

You want to focus the front-most window at given coordinates? Or do you want to focus a window and move it to defined coordinates? If the latter, position is window center or top left corner?

balmma commented 4 years ago

I'm pretty sure @PfrLisBerndt means the latter one :-)

@RaiMan

Should't be too hard to implement

balmma commented 4 years ago

MacOS: AppleScript

Something like:

tell application "System Events" to tell process "Safari"
    set position of window 1 to {0, 50}
    set size of window 1 to {600, 650}
end tell
LisBerndt commented 4 years ago

Are there ambitions to realize a positioning function to focus a window to defined coordinates

You want to focus the front-most window at given coordinates? Or do you want to focus a window and move it to defined coordinates? If the latter, position is window center or top left corner?

We handle two windows: one for our UI to be tested and another one for a telnet terminal which receives commands. Initializing our test we first position each window to a specific position, side by side. While performing the test we focus them depending on the upcoming action.