SikuliX1 icon indicating copy to clipboard operation
SikuliX1 copied to clipboard

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

Open LisBerndt opened this issue 5 years ago • 4 comments

implementation suggestion

  • Windows: SetWindowPos
  • Linux: xdotool windowmove / xdotool windowsize
  • MacOS: AppleScript
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

Hello again!

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.

LisBerndt avatar Jan 30 '20 10:01 LisBerndt

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 avatar Jan 30 '20 10:01 balmma

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

@RaiMan

Should't be too hard to implement

  • Windows: SetWindowPos
  • Linux: xdotool windowmove / xdotool windowsize
  • MacOS: No idea :-)

balmma avatar Jan 30 '20 11:01 balmma

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

balmma avatar Jan 30 '20 11:01 balmma

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.

LisBerndt avatar Jan 30 '20 11:01 LisBerndt