0

I am trying to execute some scripts from our in-house existing framework on the safari browser on Saucelabs. As soon as the application is logged in I get the browser notification to Allow or Don't Allow but I am not able to interact with it.

enter image description here

I tried using all possible suggestions available, but nothing works.

        SafariOptions browserOptions = new SafariOptions();
        browserOptions.setCapability("platformName", "macOS 10.15");
        browserOptions.setCapability("browserVersion", "latest");
        Map<String, Object> sauceOptions = new HashMap<>();
        Map<String, Object> pref = new HashMap<>();
        pref.put("permissions.default.desktop-notification",0);
        sauceOptions.put("screenResolution", "1024x768");
        sauceOptions.put("customData",pref);
        browserOptions.setCapability("sauce:options", sauceOptions);
        browserOptions.setCapability("--disable-notifications", true);

How Do I take care of this? Did I miss anything in configurations? Please help. Thanks in advance

Pulkit Shah
  • 81
  • 1
  • 10

1 Answers1

0

There is currently (Feb 2022) no way of blocking notification pop-ups for websites on Mobile Safari.

If this is your own site, I'd suggest disabling that feature during tests.

Dylan Lacey
  • 1,839
  • 12
  • 23
  • I meant I am trying the safari web browser on Sauce labs. There is no way to block notifications on the same? – Pulkit Shah Feb 21 '22 at 19:06
  • Not automatically, no. This is a limitation of Appium, not Sauce Labs. Have you tried switching to the NATIVE_APP context and dismissing the popup that way? – Dylan Lacey Feb 22 '22 at 01:13