I am having problems with updating chromedriver ( using WebDriverManager
).
Trying with below code:
private static WebDriver getChromeDriver()
{
ChromeOptions options = new ChromeOptions();
options.AddUserProfilePreference("profile.default_content_setting_values.images", 2);
options.AddArguments("headless", "--blink-settings=imagesEnabled=false");
options.AddArguments("--disable-extensions"); // to disable extension
options.AddArguments("--disable-notifications"); // to disable notification
options.AddArguments("--disable-application-cache"); // to disable cache
new DriverManager().SetUpDriver(new ChromeConfig(), VersionResolveStrategy.MatchingBrowser);
try
{
return new ChromeDriver(options);
}
catch (Exception e)
{
MessageBox.Show("Error loading Chrome. Need to update driver?");
throw;
}
}
Code returns Exception.
As far as i understand new DriverManager().SetUpDriver(new ChromeConfig(), VersionResolveStrategy.MatchingBrowser);
should take care of driver version?.
I am not experienced enough with this project. It uses Selenium to automatically log in to a website, but i would like to check and update chrome drivers first.