class WebDriver.Window

An interface for managing the current window.

new WebDriver.Window(driver)

Parameters
driverwebdriver.WebDriver

The parent driver.

Instance Methods

getPosition()code »

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

Returns
webdriver.promise.Promise<{x: number, y: number}>

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


getSize()code »

Retrieves the window's current size.

Returns
webdriver.promise.Promise<{height: number, width: number}>

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


maximize()code »

Maximizes the current window.

Returns
webdriver.promise.Promise<undefined>

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


setPosition(x, y)code »

Repositions the current window.

Parameters
xnumber

The desired horizontal position, relative to the left side of the screen.

ynumber

The desired vertical position, relative to the top of the of the screen.

Returns
webdriver.promise.Promise<undefined>

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


setSize(width, height)code »

Resizes the current window.

Parameters
widthnumber

The desired window width.

heightnumber

The desired window height.

Returns
webdriver.promise.Promise<undefined>

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