View Source Improve this doc

windowHandleSize

Protocol binding to get or change the size of the browser.

Usage

1
browser.windowHandleSize([windowHandle][,dimension]);

Parameters

Param Type Details
windowHandle
optional
String the window to receive/change the size
dimension
optional
Object the new size of the window

Example

windowHandleSize.js
1
2
3
4
5
6
7
8
9
10
11
12
13
it('should get or set window position', function () {
// change the size of a specified window
client.windowHandleSize('{dc30381e-e2f3-9444-8bf3-12cc44e8372a}', {width: 800, height: 600});
// or set the current window size
browser.windowHandleSize({width: 800, height: 600});

// get the size of a specified window
var size = browser.windowHandleSize('{dc30381e-e2f3-9444-8bf3-12cc44e8372a}');
// or of the current window
size = browser.windowHandleSize();

console.log(size); // outputs: {width: 800, height: 600}
});

Returns

  • <Object>: the size of the window ({width: number, height: number})