Window
The Window module has functionality for dealing primarily with the main window of an application. In contrast the Windows module supports interacting with all the windows on the desktop.
Title
Get the title of the main window. Optionally supply a timeout for the operation - default timeout is 500ms normally.
Example
var title = Window.title();
// or with a timeout of 2s
title = Window.title(2000);
Minimize
Minimize the main window.
Example
Window.minimize();
Is minimized
Check if the main window is minimized.
Example
if(Window.isMinimized()) {
...
}
Maximize
Maximize the main window.
Example
Window.maximize();
Is maximized
Check if the main window is maximized.
Example
if(Window.isMaximized()) {
...
}
Focus
Put focus on the main window.
Parameters
options
optional object with options for focus. Supported options:useCachedUI
boolean indicating if UI component lookup should use the UI itself or the underlying model. Defaults tofalse
(underlying model traversal).askForPermission
whether or not the user is asked for permission if Manatee is not allowed to focus (default istrue
)
Example
Window.focus();
// or do not ask for permission (then no focus is done if Manatee cannot focus)
Window.focus({ askForPermission: false });
Send keys
Send keyboard events (simulated typing) to a window. Supports special strings for sending special keys.
Parameters
keys
the keys to send - this is a stringoptions
optional object with options for sendkeys, supported options:focus
[bool] whether to focus the window prior to sending the keys
Example
Window.sendKeys("foo bar");
// or to focus the window prior to sending the keys
Window.sendKeys("foo bar", { focus: true });
Restore
Restore the main window to a previous state and location.
Example
Window.restore();
Window with modal dialog shown
Get whether or not a modal (dialog) is shown.
Example
var modalIsShown = Window.modalShown();
WARNING
Only java
Shown with title
Get whether or not a window with the given title is shown.
Example
var windowIsShown = Window.withTitleShown("My Window");
WARNING
Only java
Dim
Dims the window owned by the flow.
Parameters
level
the amount of dimming, 0-255. 255 is opaque and 0 is transparent.
Example
Window.dim(100)