Yes, just today.
In your headless ChromeOptions browser - do NOT use ‘Maximize Browser Window’.
Instaed, in its config, just use flag: --window-size=1920,1080
or use keyword: Set Window Size 1920 1080
Issue is with Selenium/Chrome - maximizing a headless window does not actually resize it to the screen size, but to a default small size (e.g. 800x600px)
Great that you were able to resolve your issue!
wouldn’t this mean we have to provide specific resolution values depending on the machine on which our tests run ? maximize browser window automatically adjusted that. I am running the tests remotely so that is an added issue for me
"wouldn’t this mean we have to provide specific resolution values depending on the machine on which our tests run ? " - No.
Just set specific size for headless. Most common screen res nowadays is 1080p or 4k, your choice. But headless apparently doesn’t care about your current display’s res.
I have a 1920x1080 px display, had Edge (mis)configured to run headless maximized, and it ran tests in 4K slight_smile:
You can use Maximize for non-headless. But yes, it’s useful to have diff configs for different browsers and modes.
@rofan for me this might depends of the machine, if running for example in a docker with xvfb, and window size has an importance on interaction, or if you use XY positions, screenshots comparison or else
Anyway, I had this issue on Docker/Linux since Chrome 133 when I opened this ticket Chromium that never moved…
Thing I don’t understand is we often see lately people raising this problem (Chrome 135, 136, 137), as if the problem was not there before (maybe driver was not updated)
@CharlieScene
Useful link!
And yes, this is not the first time I am facing this issue. Google broke stuff and didn’t clean up after that.
As I said - workaround works - just don’t use Maximize for headless. My current Chrome version - 137.0.7151.120
As for driver - has been updated - latest stable chromedriver is 137.0.7151.119 (see link).
So maybe try updating versions in your docker image.