Skip to main content
zoran0002
Participating Frequently
Nov 3, 2021 1:22 PM UTC
Question

How to block notifications poping up in Chrome

Hello!

I wonder if it is possible to tell the Chrome browser to allow or block notifications while using it with RPA?

In Selenium/Java  I would use something like this:

ChromeOptions options = new ChromeOptions();

options.AddUserProfilePreference("profile.default_content_setting_values.notifications",2); /* or 1 depending if I want to block or allow notifications */

IWebDriver driver = new ChromeDriver(options);

Best regards!

    10 replies

    danny.verb
    Employee
    Nov 3, 2021 4:48 PM UTC

    When you say 'Notifications' are you refering to browser alerts? Can you post a screenshot of one of these notifications?

    zoran0002
    zoran0002Author
    Participating Frequently
    Nov 3, 2021 5:23 PM UTC



    I can not identify this window using Selenium or Xpath and I need to allow or block the notifications to proceed to the site.

    danny.verb
    Employee
    Nov 4, 2021 3:33 PM UTC

    Using the 'driver' you can handle and submit alerts