Skip to content

[🐛 Bug]: Chrome Driver 133.0.6943.126: Chrome's resolution is scaled by a factor of 2 #15721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
gamegrobla opened this issue May 8, 2025 · 7 comments
Labels
A-needs-triaging A Selenium member will evaluate this soon! B-grid Everything grid and server related C-dotnet .NET Bindings D-chrome I-defect Something is not working as intended OS-linux

Comments

@gamegrobla
Copy link

gamegrobla commented May 8, 2025

Description

I am running selenium UI tests on the lates chrome driver version (133.0.6943.126) as a Docker SeleniumGrid container using TestContainers.

This is how I configure and spawn the container:

new WebDriverBuilder()
            .WithName(webDriverName)
            .WithBrowser(WebDriverBrowser.Chrome)
            .WithImage("selenium/standalone-chrome:133.0")
            .WithEnvironment("SCREEN_WIDTH", "1920")
            .WithEnvironment("SCREEN_HEIGHT", "1080")
            .WithEnvironment("SCREEN_DPI", "72")
            .Build();

those environment variable settings proposed by Gemini don't work

here are my my chrome flags:

        options.AddArgument("--start-maximized");
        options.AddArgument("--force-device-scale-factor=1");
        options.AddArgument("--high-dpi-support=1");
        options.AddArgument("--headless=new"); 
        options.AddArgument("--window-size=1920,1080"); 
        options.AddArgument("--ozone-override-screen-size=1920,1080"); 

the problem started occuring after switching from Chrome Driver 126 (or something around it) to 133 (as mentioned before)

setting the resolution to 1080p results in a resolution of 4k (screenshots of such resolution are taken and tests that contain checking scroll-behaviour fail because there is nothing to scroll - content is displayed in the viewport at once)

currently I set the resolution to 540p to achieve 1080p - but it is a temporary solution

Reproducible Code

new WebDriverBuilder()
            .WithName(webDriverName)
            .WithBrowser(WebDriverBrowser.Chrome)
            .WithImage("selenium/standalone-chrome:133.0")
            .WithEnvironment("SCREEN_WIDTH", "1920")
            .WithEnvironment("SCREEN_HEIGHT", "1080")
            .WithEnvironment("SCREEN_DPI", "72")
            .Build();

        options.AddArgument("--start-maximized");
        options.AddArgument("--force-device-scale-factor=1");
        options.AddArgument("--high-dpi-support=1");
        options.AddArgument("--headless=new"); 
        options.AddArgument("--window-size=1920,1080"); 
        options.AddArgument("--ozone-override-screen-size=1920,1080");
@gamegrobla gamegrobla added I-defect Something is not working as intended A-needs-triaging A Selenium member will evaluate this soon! labels May 8, 2025
@selenium-ci
Copy link
Member

@gamegrobla, thank you for creating this issue. We will troubleshoot it as soon as we can.

Selenium Triage Team: remember to follow the Triage Guide

@github-actions github-actions bot added B-grid Everything grid and server related C-dotnet .NET Bindings D-chrome OS-linux labels May 8, 2025
Copy link

github-actions bot commented May 8, 2025

⚠️ You reported using Selenium version 4.29.0, but the latest release is 4.32.

Please verify that this issue still occurs with the latest version. If it no longer applies, you can close this issue or update your comment.

This issue will be marked "awaiting answer" and may be closed automatically if no response is received.

@github-actions github-actions bot added J-awaiting answer Question asked of user; a reply moves it to triage again and removed A-needs-triaging A Selenium member will evaluate this soon! labels May 8, 2025
@gamegrobla
Copy link
Author

Using 4.32 version does not resolve the issue

@titusfortner titusfortner added A-needs-triaging A Selenium member will evaluate this soon! and removed J-awaiting answer Question asked of user; a reply moves it to triage again labels May 8, 2025
@selenium-ci
Copy link
Member

@gamegrobla, thank you for creating this issue. We will troubleshoot it as soon as we can.

Selenium Triage Team: remember to follow the Triage Guide

@diemol
Copy link
Member

diemol commented May 8, 2025

@gamegrobla the env variables should be prefixed with SE_, see the docs.

@diemol diemol added J-awaiting answer Question asked of user; a reply moves it to triage again and removed A-needs-triaging A Selenium member will evaluate this soon! labels May 8, 2025
@gamegrobla
Copy link
Author

thank you for the answer, but changing those env vars doesn't fix the issue.

for now I've discovered 2 ways to mitigate this issue:

  • dividing the width and heigth / 2
  • setting "--force-device-scale-factor" flag to 0.25 instead of 1

@diemol
Copy link
Member

diemol commented May 8, 2025

What happens when you try this on Firefox?

@github-actions github-actions bot added A-needs-triaging A Selenium member will evaluate this soon! and removed J-awaiting answer Question asked of user; a reply moves it to triage again labels May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-needs-triaging A Selenium member will evaluate this soon! B-grid Everything grid and server related C-dotnet .NET Bindings D-chrome I-defect Something is not working as intended OS-linux
Projects
None yet
Development

No branches or pull requests

4 participants