Как добавить настройки профиля в Chrome для Selenium Grid 2 в C #?
Вот как я добавляю настройки профиля в Chrome для локальных автоматических тестов и TeamCity (CI):
Capabilities = DesiredCapabilities.Chrome();
var chromeOptions = new ChromeOptionsWithPrefs();
chromeOptions.AddUserProfilePreference("download.default_directory", DownloadPath);
chromeOptions.AddUserProfilePreference("intl.accept_languages", "nl");
chromeOptions.AddUserProfilePreference("disable-popup-blocking", "true");
return new ChromeDriver(chromeDriverPath, chromeOptions);
Но когда я создаю новый «RemoteWebDriver», я должен отправить ему URL-адрес концентратора и «Capabilities», таким образом я отправляю настройки профиля в Firefox (в RemoteWebDriver):
var profile = new FirefoxProfile();
Capabilities = DesiredCapabilities.Firefox();
profile.SetPreference("browser.helperApps.alwaysAsk.force", false);
profile.SetPreference("browser.download.useDownloadDir", true);
profile.SetPreference("browser.download.folderList", 2);
profile.SetPreference("browser.download.dir", DownloadPath);
profile.SetPreference("browser.helperApps.neverAsk.saveToDisk",
"application/zip, application/octet-stream");
Capabilities.SetCapability(FirefoxDriver.ProfileCapabilityName, profile.ToBase64String());
return Capabilities;
Может кто-нибудь помочь мне, мне нужно сделать то же самое с Chrome, как я сделал с Firefox. По сути, мне нужно изменить путь загрузки файлов по умолчанию.