-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Closed
Labels
C-dotnet.NET Bindings.NET BindingsD-chromeG-chromedriverRequires fixes in ChromeDriverRequires fixes in ChromeDriverI-defectSomething is not working as intendedSomething is not working as intendedI-regressionSomething was working but we "fixed" itSomething was working but we "fixed" itOS-windows
Description
Description
When using headless Chrome mode via Selenium, any new windows or tabs opened during test execution (e.g., via window.open() or by clicking a link with target="_blank") are opened in a compressed or smaller than expected size, even though the window-size argument is passed correctly in Chrome options.
Reproducible Code
Environment:
Selenium Version: [4.31.0]
Chrome Version: [138.0.7204.158]
Chromedriver Version: [138.0.7204.157]
OS: [Windows 11]
Language: C#
Execution Mode: Headless
`else if (browser.Equals("hchrome", StringComparison.OrdinalIgnoreCase))
{
IsHeadless = true; // headless
ChromeOptions options = new ChromeOptions();
options.AddArgument("--headless");
if (isIncognito) options.AddArgument("--incognito");
options.AddArgument("--disable-extensions");
options.AddArgument("--disable-gpu");
options.AddArgument("--no-sandbox");
options.AddArgument("window-size=1920,1080");
options.AddArgument("disable-features=DownloadBubble,DownloadBubbleV2");
options.AddUserProfilePreference("download.default_directory", downloadDir);
options.AddUserProfilePreference("disable-popup-blocking", "true");
options.AddUserProfilePreference("download.prompt_for_download", false);
options.AddUserProfilePreference("profile.default_content_setting_values.automatic_downloads", 1);
options.AddUserProfilePreference("credentials_enable_service", false);
options.AddUserProfilePreference("profile.password_manager_enabled", false);
new DriverManager().SetUpDriver(new ChromeConfig());
Drivers.Value = new ChromeDriver(options);
}`
ℹ️ Last known working version: 4.16.2
Metadata
Metadata
Assignees
Labels
C-dotnet.NET Bindings.NET BindingsD-chromeG-chromedriverRequires fixes in ChromeDriverRequires fixes in ChromeDriverI-defectSomething is not working as intendedSomething is not working as intendedI-regressionSomething was working but we "fixed" itSomething was working but we "fixed" itOS-windows