'Selenium capability or option to stop 'Save Card?' popup Chrome mobile browser?

Selenium is there a capability or option to stop 'Save Card?' popup Chrome mobile browser?

I am using Browserstack automate to run selenium tests on an Android device using the Chrome browser and the popup is blocking some web elements for testing.

The popup in question: enter image description here

I cant interact with the popup as I am using 'RemoteWebDriver' & not 'AndroidDriver' so I cannot use 'AndroidDriver' specific functionality to interact with this popup event.

My WebDriver sample code:

protected WebDriver driver;

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("build", "Samsung Galaxy S21 - " + method.getName());
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("deviceName", "Samsung Galaxy S21");
capabilities.setCapability("browser", "Chrome");
capabilities.setCapability("real_mobile", "true");
capabilities.setCapability("browserstack.appium_version", "1.22.0");
capabilities.setCapability("browserstack.local", "true");
capabilities.setCapability("browserstack.networkLogs", "true");
capabilities.setCapability("autoGrantPermissions", "true");
capabilities.setCapability("disable-popup-blocking", "true");
capabilities.setCapability("autoDismissAlerts", true);
capabilities.setCapability("unicodeKeyboard", true);
capabilities.setCapability("resetKeyboard", true);

driver = new RemoteWebDriver(new URL(Browserstack_URL), capabilities);

Is there any capability or option I can set so this pop-up never appears when using RemoteWebDriver?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source