0

Team,

I am facing issues to accept the permission on iOS using Appium. I have tried below options:

  • capabilities.SetCapability("autoAcceptAlerts", true);
  • driver.switch_to_alert()
  • driver.findElement(By.id("Allow_buttonID")).click();

Still unable to accept the permission alerts i.e. Unable to tap on "Allow"

My environment :

  • Mac : 10.14
  • Appium : 1.10.0
  • Platform : iOS[any version]

1 Answer 1

0

Working solution to accept alerts on ios:

def acceptAlert(self):

     if Driver.ExecutionPlatform == Platform.iOS:
        if self.isElementPresent("Allow"):
            try:
                Driver.Instance.execute_script('mobile: alert', {'action': 'accept', 'buttonLabel': 'Allow'})
            except:
                print "alert not displayed"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.