setViewportSize method

Class: EyesPlatform: Selenium 4Language: JavaScript SDK:

Set the default viewport size property. Eyes will use this if a subsequent call to open is done without a viewport size. This also changes the browser viewport size to the given size immediately, instead of when open is called.

This property will be displayed by the Test manager along with the other test information. The value is also taken into consideration when finding a matching baseline.


await Eyes.setViewportSize(driver, viewportSize);


The driver returned from the call to open.
Type:<a class ='link' href='/Content/api/eyes-sdk/index-gen/class-rectanglesize-selenium4-javascript.htm'>RectangleSize</a>

The size of the viewport

The size of the viewport passed as an object.

The size of the viewport passed as an object {'width':, 'height':}

Return value

Type: Promise


This method is a static method.