Skip to main content

getWindowSize

Overview

Use the getWindowSize command to get the size of the browser window.

Usage

await browser.getWindowSize();

Usage Examples

it("should return browser window size", async ({ browser }) => {
const windowSize = await browser.getWindowSize();

console.log(windowSize); // outputs: { width: 1280, height: 767 }
});

References

We'd like to give credit to the original WebdriverIO docs article, from which we drew some information while writing our version.