I am currently running Selenium tests through an Azure DevOps pipeline using C#. I made a change to my code to write ChromeDriver logs, which necessitated a change to using the ChromeDriverService.
string binaryDir = Manager.GetWebDriver(Manager.BrowserType.CHROME,os,browser);
if (options == null) options = new ChromeOptions();
options.AddUserProfilePreference("download.default_directory", ExtentReporter.ReportDir);
options.SetLoggingPreference(LogType.Browser, LogLevel.Info);
options.UnhandledPromptBehavior = UnhandledPromptBehavior.Ignore;
Console.WriteLine("Chrome Logging path: "+chromeLogPath);
var service = ChromeDriverService.CreateDefaultService(binaryDir);
service.LogPath = chromeLogPath;
service.EnableVerboseLogging = true;
_driver = new ChromeDriver(service, options);
_driver.Manage().Window.Maximize();
return _driver;
After making this change the chromedriver is no longer able to open with the error: OpenQA.Selenium.WebDriverException : Cannot start the driver service on http://localhost:52257/
I have also copied the compiled code out of the Agent directory and executed it via command line and it was able to run all tests. BUT when executed via command line within the Agent work directory the ChromeDriverService threw the previous exception.
I believe the issue is related to the creation of the ChromeDriver logs, but I am also generating files in the Agent Work directory without any errors.
Any previous experience of the WebDriveService or generating ChromeDriver logs through Azure DevOps will be much obliged.