Skip to main content
🇺🇦  We stand with the people of Ukraine. We encourage compassion, and hope for peace.   🇺🇦
Please support humanitarian efforts for the Ukraine crisis through the International Committee of the Red Cross! #StandWithUkraine

setViewport

Resizes the browser viewport within the browser. As oppose to setWindowSize, this command changes the viewport size, not the window size.

Usage
browser.setViewport({ width, height, devicePixelRatio })
Parameters
NameTypeDetails
optionsSetViewportOptionscommand arguments
options.widthnumberviewport width in pixels
options.heightnumberviewport height in pixels
options.devicePixelRationumberpixel ratio of the viewport
Returns
  • <Promise<void>>

Welcome! How can I help?

WebdriverIO AI Copilot
Morty Proxy This is a proxified and sanitized view of the page, visit original site.