
# Pass the argument 1 to allow and 2 to block Option.add_argument("-disable-extensions") tPreference("-notification", 1) ĭesiredCapabilities capabilities=DesiredCapabilities.firefox() ĬtCapability(FirefoxDriver.PROFILE, profile) ĭriver = new FirefoxDriver(capabilities) ī) USING PYTHON : from selenium import webdriverįrom import Options WebDriver driver = new ChromeDriver(options) įirefoxProfile profile = new FirefoxProfile()

Now Pass ChromeOptions instance to ChromeDriver Constructor to initialize chrome driver which will switch off this browser notification on the chrome browser Prefs.put("fault_content_setting_values.notifications", 2) ĬhromeOptions options = new ChromeOptions() Pass the argument 1 to allow and 2 to block add key and value to map as follow to switch off browser notification
:max_bytes(150000):strip_icc()/003_stop-pop-up-ads-android-4177859-b5cc74982db9450aae573594ee8d856b.jpg)
For Old Chrome Version (50): //Create a map to store preferences
