Up until last week this has worked a charm in headless mode with an Azure pipelime and also local with this setup code
We are using Visual Studio/C#/Selenium 4.33
We use ChromiumDriver for our Windows Desktop tests
protected static ChromiumDriver? Driver { get; set; } = null; Mon,Web,Fri this kicks off Chrome, Tues & Thurs MS Edge
var options = new EdgeOptions
{
PageLoadStrategy = PageLoadStrategy.Normal
};
options.AddArgument("enable-automation");
options.AddArgument("disable-dev-shm-usage");
options.AddArgument("ignore-certificate-errors");
options.AddArgument("ignore-ssl-errors");
options.AddArgument("disable-popup-blocking");
options.AddArgument("window-size=1920,1080");
options.AddUserProfilePreference("download.default_directory", DownloadPath);
if (!Debugger.IsAttached)
options.AddArgument("headless");
options.AddArgument("disable-gpu");
var service = EdgeDriverService.CreateDefaultService();
Driver = new EdgeDriver(service, options, TimeSpan.FromSeconds(MaxWait));
SetTimeOuts(MaxWait);
Driver.Manage().Cookies.DeleteAllCookies();
Driver.Manage().Window.Maximize();
Driver.ExecuteCdpCommand(
"Emulation.setTimezoneOverride",
new Dictionary<string, object>
{
["timezoneId"] = "Europe/London"
});So early last week we updated Selenium.WebDriver.ChromeDriver from 135 to 136 and things have fallen apart with our desktop tests. We also have a set of tests using Playwright, these are working fine.
I have grabbed a screenshot on our app in code while running in headless mode and these confirm the app have started running in tablet mode since the webdriver update.
The screensize appears to be 784 by 445
In our app this means that certainm buttons and links will not be available and the menu options are hidden until the mobile button is pressed (see image). This has caused the fails.
My question is why has this change, the settings above have work for just over 3 years now, whta has change in ChromeDriver and how do I force full screen desktop mode again
I have added
options.AddArgument("user-agent=Chrome/136.0.0.0");But no affect
Kev