set_viewport_size method

Class: EyesPlatform: Selenium 3Language: Python SDK:

Set the default viewport size property. Eyes uses 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.


value = Eyes.set_viewport_size(driver, size)
Eyes.viewport_size  = value
python_sdk4: eyes.viewport_size Warning : void return value None on overload - ignored - assumed its a private setter.

Note: This method is a static method.

Note that this feature is available as both a method and a property.


The driver returned from the call to open.

Type definitions

The type AnyWebDriver is defined as: Union[EyesWebDriver,WebDriver]. This object can be used in the same way as the Selenium driver object.

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':}

Type definitions

The type ViewPort is defined as: Union[Dict[Text,int],RectangleSize]

Return value

Type: None


  • Call this method before the call to Then, when calling the open method, don't pass the viewportSize parameter. If the viewport size is set to be smaller than the actual content, then scrolling should typically be enabled by calling set_force_full_page_screenshot method so that the full page image is tested.
This method is a static method.