View Source Improve this doc

windowHandleMaximize

Maximize the specified window if not already maximized. If the :windowHandle URL parameter is “current”, the currently active window will be maximized.

Usage

1
browser.windowHandleMaximize([windowHandle]);

Parameters

Param Type Details
windowHandle
optional
String window to maximize (if parameter is falsy the currently active window will be maximized)

Example

windowMaximize.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
it('should maximize the passed window handle', function () {
// get current window handle
var windowHandle = browser.windowHandle();
console.log(windowHandle);

// outputs something like the following:
// {
// state: 'success',
// sessionId: 'e6782264-9eb1-427b-9250-d8302ac35161',
// hCode: 988127308,
// value: 'CDwindow-849D79B1-5CCB-4A1D-A217-5BA809D935F3',
// class: 'org.openqa.selenium.remote.Response',
// status: 0
// }

// pass windowHandle.value to windowHandleMaximize
browser.windowHandleMaximize('{'+windowHandle.value+'}');
});