Temporarily disable autoAcceptAlerts for appium and then re-enable

So currently I understand that autoAcceptAlerts is a desired capability for iOS. If I set this desired capability to “true” when creating the appium driver all alerts gets accepted as expected.

However, what I would like to do is midway through the app there is an alert I don’t want to immediately auto-accept. Rather I would like to enter something into the alert text box, press the “Set” button and continue forward. And from everything after that point all alerts should be accepted.

Effectively I want to temporarily disable autoAcceptAlerts and then re-enable it. Is there a way to do this in appium?

Even I am looking for a solution on this, let me know if you get a workaround.

the only way is - remove autoAccept and manage all by yourself :slight_smile:

So thinking about it some more it may make sense to remove autoAcceptAlerts and just manage all the alerts ourselves which is fine so that we have complete control over alerts.

However, this does raise a question for me:

So I was looking at some of the appium documentation here: https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/settings.md

And from the documentation it looks like desired capabilities and settings are completely different concepts. However, what I found odd was that some of the supported settings that are run-time configurable such as “ignoreUnimportantViews” are a setting that can be run-time configurable but are also a desired capability based on the docs here:

So my question is then does it make sense to make have a desired capability such as autoAcceptAlerts as a run-time configurable setting? Or was the example above a one-off that we shouldn’t follow?

Any thoughts would be greatly appreciated?

@zfighter876 I tried setting >ignoreUnimportantViews< to TRUE but I was getting the problem of not finding_elements_by_xpath. But the other options like by_class_name worked.

Hi @zfighter876, I have the same problem, do you have any solution?