Skip to content

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

Open
@gamegrobla

Description

@gamegrobla

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");

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!B-gridEverything grid and server relatedC-dotnet.NET BindingsD-chromeI-defectSomething is not working as intendedOS-linux

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions