小编del*_*lex的帖子

Selenium 禁用恢复页面弹出

我正在使用 selenium C#,我正在尝试禁用“崩溃”chrome 的弹出窗口: https://i.stack.imgur.com/xudon.png

我尝试设置配置文件首选项,但似乎它根本没有改变,代码:

        ChromeOptions options = new ChromeOptions();
        options.AddUserProfilePreference("exit_type", "Normal");
        options.AddUserProfilePreference("exited_cleanly", "true");
        IWebDriver driver = new ChromeDriver(options);
Run Code Online (Sandbox Code Playgroud)

我尝试将退出类型的值更改为“none”和“None”,但在首选项文档中没有任何更改。

c# selenium google-chrome selenium-chromedriver

7
推荐指数
1
解决办法
5847
查看次数