How to allow the Notifications on browsers for mobile

How do I allow the Notifications on browsers for mobile .

So this pop-up comes once i log in with my account. I was able to allow the permissions for using the camera and mic but facing challenge for notifications settings on mobile browser.

If someone can help here, if they have already automated this.

I’m using Katalon studio 10.3

1 Like

Hi @akshay_sartabe,

Thank you for sharing your issue. I found som of the following guides, please take a look:

In Katalon Studio 10.3, handling mobile browser notifications is tricky compared to camera and microphone permissions. The reason is that push notification prompts are managed at the browser or OS level, not directly exposed through automation APIs.

:white_check_mark: Professional Workarounds:

  1. Pre-configure Browser Profile – Launch Chrome with a profile where notifications are already allowed. This bypasses the prompt during execution.

  2. ChromeOptions Flags – Use mobile emulation or command-line flags (like --disable-notifications) to control how prompts behave.

  3. Real Device Settings – If you’re testing on a physical device, configure notification permissions directly in the device settings before running your tests.

  4. Test Strategy – Instead of relying on system prompts, consider mocking push notification events during test execution.

Many automation engineers face this exact challenge, so it’s more of a browser-level limitation than a Katalon issue. If you want more detailed, community-tested solutions.

Would be nice if you can give more details on community-tested solutions

@Elly_Tran

I basically need the mentioned preferences and options to be included.

But the “profile.default_content_setting_values.notifications”: 1 is not getting applied.

I’m not sure if this is the correct way of adding all these.

Hi @akshay_sartabe,

Sorry for my late response. On Mobile Chrome, you can’t reliably “auto-Allow” that notification prompt with
profile.default_content_setting_values.notifications , it only works for desktop-Chrome profiles.

If your goal is “don’t be blocked by the popup”, not “test notifications themselves”, add --disable-notifications in args.

If you test notification-enabled behavior, you can try to pre-configure the device/browser by manually tapping Allow once then reuse it for automation or Android Settings → Apps → Chrome → Notifications and ensure notifications are allowed globally.

Let us know if your issue is solved. Thank you

have you found workaround??

You’re trying to automate the browser notification permission dialog on a mobile browser in Katalon Studio 10.3. You’ve successfully handled camera and microphone permissions but are facing challenges with the notification permission popup.

The issue is that browser notification permissions are handled differently than native Android permissions. Browser notification dialogs are JavaScript-based popups that require a different approach than system-level permissions.

Root Cause

Browser notification permission dialogs (like the one shown in your screenshot) are not native Android system dialogs — they’re browser-specific popups that can be:

  1. Pre-configured using Chrome desired capabilities before the browser launches
  2. Handled via JavaScript during test execution
  3. Dismissed/Allowed by interacting with the dialog elements directly

The autoGrantPermissions capability you used for camera/microphone works for native Android permissions, but notification permissions are browser-level permissions that require Chrome-specific configuration.

Solutions

Solution 1: Pre-Configure Chrome to Auto-Grant Notifications (Recommended)

This is the cleanest approach — configure Chrome to automatically grant notification permissions before your test runs.

Steps:

  1. Go to Project > Settings > Desired Capabilities > WebUI > Chrome (or Chrome headless if testing headless)
  2. Click Add and configure the following:
Name Type Value
prefs Dictionary Click More (…) and add the values below

In the Dictionary Property Builder, add:

Name Type Value
profile.default_content_settings.notifications Number 1

Alternatively, edit the Chrome properties file directly:

Go to <your test project location>\settings\internal\com.kms.katalon.core.webui.chrome.properties and add:

{
  "CHROME_DRIVER": {
    "prefs": {
      "profile.default_content_settings.notifications": 1
    }
  }
}

Explanation:

  • 1 = Allow notifications
  • 2 = Block notifications
  • 0 = Ask (default)

Source: Set up Desired Capabilities for WebUI Testing in Katalon Studio


Solution 2: Handle the Notification Dialog by Clicking “Allow” Button

If pre-configuration doesn’t work, you can interact with the dialog directly in your test script.

Script Mode Example:

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

// Open browser with mobile emulation
WebUI.openBrowser('')

// Navigate to your application
WebUI.navigateToUrl('https://k.azurewebsites.net')

// Wait for the notification dialog to appear
WebUI.waitForElementPresent(findTestObject('Object Repository/notification_allow_button'), 10)

// Click the "Allow" button
WebUI.click(findTestObject('Object Repository/notification_allow_button'))

// Continue with your test
WebUI.click(findTestObject('Object Repository/login_button'))

To create the test object for the “Allow” button:

  1. In Katalon Studio, go to Object Repository
  2. Create a new test object called notification_allow_button
  3. Use the following XPath or CSS selector:

XPath:

//button[contains(text(), 'Allow')]

CSS Selector:

button:contains('Allow')

Solution 3: Dismiss the Dialog Using JavaScript

If the dialog is blocking your test, you can dismiss it programmatically:

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

// Execute JavaScript to dismiss notification permission request
WebUI.executeJavaScript("""
  if (Notification.permission !== 'granted') {
    // This will dismiss the notification request
    window.close();
  }
""", null)

Solution 4: Combine Android Permission Management with Chrome Preferences

For a comprehensive approach that handles both native and browser permissions:

Custom Keyword:

@Keyword
public static void setupMobilePermissions() {
    // Enable Android native permissions
    DesiredCapabilities.android().setCapability("autoGrantPermissions", true)
    
    // Configure Chrome to auto-grant notifications
    Map<String, Object> prefs = new HashMap<>()
    prefs.put("profile.default_content_settings.notifications", 1)
    
    DesiredCapabilities.chrome().setCapability("prefs", prefs)
}

Reference: Manage Android’s Permission in Katalon Studio


Recommended Next Steps

  1. Try Solution 1 first — it’s the most reliable and requires no test code changes
  2. If Solution 1 doesn’t work, use Solution 2 to interact with the dialog directly
  3. Test on both desktop and mobile emulation to ensure compatibility

hi @akshay_sartabe

i think this is an android mobile browser limitation not a katalon issue

on android chrome, the notification permission popup is system-level, not a web element
because of that katalon WebUI cannot interact with it even though camera/mic permissions work

my recommendation for stable automation, pre-configure notification permissions on the device/emulator instead of trying to automate the popup

Hi @Monty_Bagati thanks for detailed solution/explanation. I will try these out.

Just wanted to confirm if this would work for

  • Chrome on Android mobiles
  • Safari on iOS mobiles
  • Most importantly on Katalon Test Cloud execution on mobile devices (android and iOS)

or some different strategy is required?