How to Auto-Dismiss Location Permission Alerts in iOS Simulator Using Robot Framework Appium?

I’m facing an issue where I can’t allow the location permission on the simulator. I’ve tried the following method, but it only works on iOS 18:

I’m running tests on iOS Simulator using Appium, and my app triggers the standard location permission: “Allow Once” / “Allow While Using App” / “Don’t Allow”.
I’ve already tried setting these desired capabilities:

  • "autoAcceptAlerts": true
  • "autoDismissAlerts": true

But the alert is not dismissed automatically. I also tried locating the alert buttons manually using XPath or accessibility ID, but the elements are not visible or interactable through Appium.

Is there a reliable way to auto-dismiss or bypass this alert during automation on iOS simulators?
I’m currently using: Appium 2.19.0, iOS 18.4 Simulator, Robot Framework 7.3.2

Any suggestions or best practices would be appreciated.

Hello @yullyayuu,
On iOS 18+, autoAcceptAlerts and autoDismissAlerts may not reliably handle location popups due to UI changes.
Try using acceptAlertButtonSelector or manually interact via MobileBy.id("Allow") if visible.
Alternatively, pre-configure location permissions using .plist injection or reset simulator permissions before each test.
For consistent automation, consider mocking location or using Appium Settings API if supported.
More details on Stack Overflow’s Appium thread.

Best Regards,
Thomas Henry