[img]https:/ /i.sstatic.net/JpDGR0M2.png[/img]
я пробую этот код, но не работает:
Код: Выделить всё
FirefoxDriverService cService = FirefoxDriverService.CreateDefaultService(".", "geckodriver.exe");
cService.HideCommandPromptWindow = true;
FirefoxOptions options = new FirefoxOptions();
options.AddArgument("ignore-certificate-errors");
options.AddArgument("--user-data-dir=" + FolderPathToStoreSession);
options.AddArgument("--disable-notifications");
options.AddArguments("Firefox.switches", "--disable-extensions");
//options.AddArguments ("profile.default_content_setting_values.cookies", "1");
options.SetPreference("network.cookie.cookieBehavior", "0");
options.SetPreference("profile.default_content_setting_values.cookies", "1");
Код: Выделить всё
var alert = driver_Ref.SwitchTo().Alert();
alert.Accept();
как нажать «Разрешить» во всплывающем окне или разрешить автоматически
Подробнее здесь: https://stackoverflow.com/questions/790 ... um-c-sharp
Мобильная версия