美文网首页Java日常学习
java+selenium,关闭chrome的通知弹窗

java+selenium,关闭chrome的通知弹窗

作者: LeslieFind | 来源:发表于2018-11-22 16:01 被阅读0次
public class Login {
    public static void main(String[] args) {
        String url = "https://www.baidu.com/";

        Map<String, Object> prefs = new HashMap<String, Object>();
        prefs.put("profile.default_content_setting_values.notifications", 2);
        ChromeOptions options = new ChromeOptions();
        options.setExperimentalOption("prefs", prefs);
        WebDriver driver = new ChromeDriver(options);
    }
}

相关文章

网友评论

    本文标题:java+selenium,关闭chrome的通知弹窗

    本文链接:https://www.haomeiwen.com/subject/qtilqqtx.html