Skip to content

[🐛 Bug]: Screen Resolution Issue with Headless Chrome,Firefox and Edge on EC2 Instance #15911

Closed
@CoolnLovely

Description

@CoolnLovely

Description

I’ve been encountering a display resolution issue with Chrome on the agents since the end of May while running automation deployments via Azure Pipelines. I used the following ChromeOptions to set the window size to 1920x1080 in headless mode but the issue still persists.

These configurations have been in place since 2022 and have worked reliably until recently. However, for the past few weeks—they no longer seem to affect the screen resolution.
I installed latest versions of Selenium and chrome driver.

Below are the chrome options to set window size in headless mode-

ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.AddArguments("--headless");
chromeOptions.AddArguments("--window-size=1920,1080");
chromeOptions.AddArguments("--start-maximized");
return new ChromeDriver(chromeOptions);

Reproducible Code

ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.AddArguments("--headless");
chromeOptions.AddArguments("--window-size=1920,1080");
chromeOptions.AddArguments("--start-maximized");
 return new ChromeDriver(chromeOptions);

Debugging Logs

025-06-18T22:06:15.8396426Z **************** Starting test execution *********************
2025-06-18T22:06:15.8508180Z Using new test platform for test execution
2025-06-18T22:06:15.8509259Z Microsoft.TestPlatform.VsTestConsole.TranslationLayer.VsTestConsoleWrapper instance will be created
2025-06-18T22:06:18.9894506Z RunMessage : NUnit Adapter 4.1.0.0: Test execution started
2025-06-18T22:06:19.0050998Z RunMessage : Running selected tests in C:\Agent\_work\r9\a\_nCinoCML\extract\nCinoCML.dll
2025-06-18T22:06:19.1549859Z RunMessage :    NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
2025-06-18T22:06:20.2748263Z RunMessage : Starting ChromeDriver 137.0.7151.119 (e0ac9d12dff5f2d33c935958b06bf1ded7f1c08c-refs/branch-heads/7151@{#2356}) on port 59133
2025-06-18T22:06:20.2749623Z RunMessage : Only local connections are allowed.
2025-06-18T22:06:20.2758009Z RunMessage : Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
2025-06-18T22:06:20.3031720Z RunMessage : ChromeDriver was started successfully on port 59133.
2025-06-18T22:07:09.5942318Z RunMessage : Running test with OpenQA.Selenium.Chrome.ChromeDriver
2025-06-18T22:07:09.5943981Z Window Size: Width = 800, Height = 600

ℹ️ Last known working version: older versions from 3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions