Class WebDriverWindow

An interface for managing the current window.

Index

Constructor methods

Methods

Constructor methods

constructor(driver: WebDriver): WebDriverWindow

constructor

Parameters

Returns

WebDriverWindow

Methods

public getPosition(): Promise

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

Returns

Promise

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

public getSize(): Promise

Retrieves the window's current size.

Returns

Promise

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

public maximize(): Promise

Maximizes the current window.

Returns

Promise

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

public setPosition(x: number, y: number): Promise

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

Promise

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

public setSize(width: number, height: number): Promise

Resizes the current window.

Parameters

  • width: number

    The desired window width.

  • height: number

    The desired window height.

Returns

Promise

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