Selenium how to disable chrome Save Address prompt?
It does not affect testing. But it affects video recordings for demo by running selenium test.
How to disable it?
CodePudding user response:
To disable notification in Chrome
browser client take you can use a setExperimentalOption() passing there a HashMap containing profile.default_content_setting_values.notifications
with Value of 2
, as following:
System.setProperty("webdriver.chrome.driver", "C:\\path\\to\\chromedriver.exe");
Map<String, Object> prefs = new HashMap<String, Object>();
prefs.put("profile.default_content_setting_values.notifications", 2);
prefs.put("credentials_enable_service", false);
prefs.put("profile.password_manager_enabled", false);
ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("prefs", prefs);
options.addArguments("start-maximized");
options.addArguments("disable-infobars");
options.addArguments("--disable-extensions");
options.addArguments("--disable-notifications");
WebDriver driver = new ChromeDriver(options);
CodePudding user response:
experiencing the same issue, Tried the above code snippet but it does not help.