Search code examples
seleniumselenium-webdrivergalenselenium-edgedrivermicrosoft-webdriver

Selenium MicrosoftEdgeDriver will not resize browser accurately


I am running some visual regression tests under the Galen framework, using MicrosoftEdgeDriver. Is anyone else having an issue where the browser being resized to a number different than desired?

When sizing to, say, height = 640 and width = 360, I get the following:

System.out.println("edge browser size: " + getDriver().manage().window().getSize()); System.out.println("expected browser size is: " + height + ", " + width); result:

edge browser size: (768, 383) expected browser size is: 640, 360

for height x width of 1024x768:

edge browser size: (768, 383) expected browser size is: 640, 360

for height x width = 768x1024:

edge browser size: (777, 1028) expected browser size is: 768, 1024

Since this behavior is consistent, my tests are passing, but I just want to ensure that I am not missing something, or if there is indeed an issue with MicrosoftWebDriver.exe.

I have not conducted the same test in firefox, chrome, or IE.


Solution

  • It's working as expected, as window size is the size of the outer windows, see here: "... This will return the outer window dimension, not just the view port."

    Galen sets the view port size as this is the one affecting the rendering!