Skip to main content

setWindowSize

Resizes browser window outer size according to provided width and height. Based on your operating system some browser windows might now allow you so have a smaller width than 500px. If you want to mimic the viewport of e.g. an iPhone you should consider using the setViewport command.

Usage​

await browser.setWindowSize(width, height)

Parameters​

NameTypeDetails
widthnumberbrowser will be resized to provided width
heightnumberbrowser will be resized to provided height

Returns​

  • <Null|Object> return: Null for NOW3C browser and Object {x, y, width, height} for W3C browser

Welcome! How can I help?

WebdriverIO AI Copilot