Using selenium to write tests with JavaScript specifically. When we are running our tests we want the browser to either have notifications disabled or this pane to close. See this image
This is causing some errors that we do not want.
I have attempted a variety of courses as noted in the selenium docs to handle alerts and popups but they haven’t worked in this case.
var chromeCapabilities = webdriver.Capabilities.chrome();
var chromeOptions = {
'args': ['--disable-notifications']
};
chromeCapabilities.set('chromeOptions', chromeOptions);
exports.chromeOptions = chromeOptions;
I have also tried to build the driver with these capabilities to disable notifications but again this hasn’t worked. After going down the rabbit hole I have come to ask my question here.
I’d appreciate a solution to my trap! Thanks in advance.