Following code worked well in the past. After some days, I try to run it again but it throws such error.
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Support.UI;
public static ChromeDriver driver;
protected void initDriver(string userDataPath) {
var driverService = ChromeDriverService.CreateDefaultService(AppDomain.CurrentDomain.BaseDirectory);
ChromeOptions options = new ChromeOptions();
driverService.HideCommandPromptWindow = true;
//options.AddArguments("--headless");
options.AddArguments("--no-sandbox");
options.AddArguments("disable-extensions");
options.AddArguments("--start-minimized");
driver = new ChromeDriver(driverService, options, TimeSpan.FromSeconds(10*60));
}
Error:
OpenQA.Selenium.WebDriverException: 'Cannot start the driver service on http://localhost:60623/'