While running Selenium tests using the Chrome driver on a virtual machine created in vSphere/VMware, the window size seems to be limited. Our tests try to set the window size to 1920x1080, which results in the following log messages:
2019-11-04 10:14:55.1255 WARN Reloading WebDriver.
2019-11-04 10:14:55.1385 TRACE Choosed browser from config: Chrome
2019-11-04 10:14:59.8548 TRACE Window.Size: 1004 width and 748 height. Size is changing
2019-11-04 10:15:00.0728 TRACE Webdriver browser name: chrome
2019-11-04 10:15:00.0768 TRACE Webdriver browser version: 77.0.3865.120
2019-11-04 10:15:00.0768 TRACE Platform : Any
2019-11-04 10:15:00.0768 TRACE Browser size: {Width=1044, Height=788}
2019-11-04 10:15:00.0918 WARN WebDriver reloaded.
As you can see the window size is increased slightly but not to the configured size. Configuring a lower window size, like 800x600, results in the following log messages:
2019-11-04 10:14:55.1255 WARN Reloading WebDriver.
2019-11-04 10:14:55.1385 TRACE Choosed browser from config: Chrome
2019-11-04 10:14:59.8548 TRACE Window.Size: 1004 width and 748 height. Size is changing
2019-11-04 10:15:00.0728 TRACE Webdriver browser name: chrome
2019-11-04 10:15:00.0768 TRACE Webdriver browser version: 77.0.3865.120
2019-11-04 10:15:00.0768 TRACE Platform : Any
2019-11-04 10:15:00.0768 TRACE Browser size: {Width=800, Height=600}
2019-11-04 10:15:00.0918 WARN WebDriver reloaded.
So, in this case the window size was updated successfully. So it seems like the window size is limited in some way, likely by the screen resolution of the VM.
We've updated the VMware tools on the machine and we also increased the video memory of the machine from 8 to 16 MB. Both of these attempts resulted in the same behaviour.
So, the question is: does anyone know how we can increase the screen resolution of the VM (e.g. in the vSphere web client) so our Selenium tests can run with a window size of 1920x1080?