# Class webdriver.WebDriver.Window

code »

An interface for managing the current window.

## Constructor

webdriver.WebDriver.Window ( driver )

Parameters
driver: `!webdriver.WebDriver` The parent driver.

Show:Public Protected Private

## Instance Methods

code »getPosition ( ) ⇒ `!webdriver.promise.Promise`

Retrieves the window's current position, relative to the top left corner of the screen.

Returns
A promise that will be resolved with the window's position in the form of a {x:number, y:number} object literal.

code »getSize ( ) ⇒ `!webdriver.promise.Promise`

Retrieves the window's current size.

Returns
A promise that will be resolved with the window's size in the form of a {width:number, height:number} object literal.

code »maximize ( ) ⇒ `!webdriver.promise.Promise.<void>`

Maximizes the current window.

Returns
A promise that will be resolved when the command has completed.

code »setPosition ( x, y ) ⇒ `!webdriver.promise.Promise.<void>`

Repositions the current window.

Parameters
x: `number` The desired horizontal position, relative to the left side of the screen. y: `number` The desired vertical position, relative to the top of the of the screen.
Returns
A promise that will be resolved when the command has completed.

code »setSize ( width, height ) ⇒ `!webdriver.promise.Promise.<void>`

Resizes the current window.

Parameters
width: `number` The desired window width. height: `number` The desired window height.
Returns
A promise that will be resolved when the command has completed.

## Instance Properties

code »driver_ : `!webdriver.WebDriver`