Disable Chrome notifications (Selenium)

后端 未结 5 1525
暗喜
暗喜 2020-12-06 17:46

I just want to disable Chrome notifications in the Chrome opened by a Selenium Java application. (using java code)

Notifications like this one:

The

5条回答
  •  渐次进展
    2020-12-06 18:25

                ChromeOptions ops = new ChromeOptions();
                ops.addArguments("--disable-notifications");
                System.setProperty("webdriver.chrome.driver", "./lib/chromedriver");
                driver = new ChromeDriver(ops);
    

提交回复
热议问题