# Temporarily disable autoAcceptAlerts for appium and then re-enable

**URL:** <https://discuss.appium.io/t/temporarily-disable-autoacceptalerts-for-appium-and-then-re-enable/12523>\
**Category:** Support\
**Created:** [October 3, 2016, 5:28am UTC](https://discuss.appium.io/t/temporarily-disable-autoacceptalerts-for-appium-and-then-re-enable/12523 "2016-10-03T05:28:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zfighter876](https://discuss.appium.io/letter_avatar_proxy/v4/letter/z/47e85d/32.png) [@zfighter876](https://discuss.appium.io/u/zfighter876)\
**Post date:** [October 3, 2016, 5:28am UTC](https://discuss.appium.io/t/temporarily-disable-autoacceptalerts-for-appium-and-then-re-enable/12523/1 "2016-10-03T05:28:20Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Venkatesh](https://discuss.appium.io/user_avatar/discuss.appium.io/venkatesh/32/5358_2.png) [@Venkatesh](https://discuss.appium.io/u/Venkatesh)\
**Post date:** [October 4, 2016, 9:32am UTC](https://discuss.appium.io/t/temporarily-disable-autoacceptalerts-for-appium-and-then-re-enable/12523/2 "2016-10-04T09:32:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Aleksei](https://discuss.appium.io/user_avatar/discuss.appium.io/aleksei/32/6267_2.png) [@Aleksei](https://discuss.appium.io/u/Aleksei)\
**Post date:** [October 4, 2016, 11:37am UTC](https://discuss.appium.io/t/temporarily-disable-autoacceptalerts-for-appium-and-then-re-enable/12523/3 "2016-10-04T11:37:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![zfighter876](https://discuss.appium.io/letter_avatar_proxy/v4/letter/z/47e85d/32.png) [@zfighter876](https://discuss.appium.io/u/zfighter876)\
**Post date:** [October 5, 2016, 5:16pm UTC](https://discuss.appium.io/t/temporarily-disable-autoacceptalerts-for-appium-and-then-re-enable/12523/4 "2016-10-05T17:16:13Z")

</div>

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](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:

> <https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/caps.md>

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?

---

<div class="post-metadata">

**Author:** ![M\_Abdur\_Rafey\_Ahmed](https://discuss.appium.io/user_avatar/discuss.appium.io/m_abdur_rafey_ahmed/32/9186_2.png) [@M\_Abdur\_Rafey\_Ahmed](https://discuss.appium.io/u/M_Abdur_Rafey_Ahmed)\
**Post date:** [September 11, 2021, 4:55am UTC](https://discuss.appium.io/t/temporarily-disable-autoacceptalerts-for-appium-and-then-re-enable/12523/5 "2021-09-11T04:55:36Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![1151](https://discuss.appium.io/user_avatar/discuss.appium.io/1151/32/9906_2.png) [@1151](https://discuss.appium.io/u/1151)\
**Post date:** [March 29, 2022, 11:35pm UTC](https://discuss.appium.io/t/temporarily-disable-autoacceptalerts-for-appium-and-then-re-enable/12523/6 "2022-03-29T23:35:15Z")

</div>

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