Search code examples
javaautomationappiumxcuitest

Appium: autoAcceptAlert doesn't work to allow access to all photos on IOS 14


The problem is that in IOS 14 there is a third option of permission of photos and autoAcceptAlerts is clicking 'don't allow' in case of any passed argument.


Solution

  • Resolved with adding acceptAlertButtonSelector to the desired caps:
    Java

    driver.setSetting("acceptAlertButtonSelector", "**/XCUIElementTypeButton[label == 'Allow While Using App']");
    

    Python

    "acceptAlertButtonSelector": "**/XCUIElementTypeButton[label == 'Allow While Using App']"