# GUI Automation: Wait for any of two events

**URL:** <https://community.automationedge.com/t/gui-automation-wait-for-any-of-two-events/4876>\
**Category:** Process Studio\
**Tags:** rpa\
**Created:** [October 6, 2021, 2:25pm UTC](https://community.automationedge.com/t/gui-automation-wait-for-any-of-two-events/4876 "2021-10-06T14:25:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Federico.chaves](https://avatars.discourse-cdn.com/v4/letter/f/b3f665/32.png) [@Federico.chaves](https://community.automationedge.com/u/Federico.chaves)\
**Post date:** [October 6, 2021, 2:25pm UTC](https://community.automationedge.com/t/gui-automation-wait-for-any-of-two-events/4876/1 "2021-10-06T14:25:34Z")

</div>

Hello,

Im automating a GUI application.

Rigth now, im having this situation where any of two events can happen:

- if everything goes rigth with the process that is being automated, a button is enabled.
- if there is an error in the processthat is being automated, an alert message is shown.

is there a way to use “element action” (wait until) so AE can wait for either of this events?

---

<div class="post-metadata">

**Author:** ![Garr14](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.automationedge.com/garr14/32/824_2.png) [@Garr14](https://community.automationedge.com/u/Garr14)\
**Post date:** [October 6, 2021, 10:04pm UTC](https://community.automationedge.com/t/gui-automation-wait-for-any-of-two-events/4876/2 "2021-10-06T22:04:17Z")

</div>

Hello @Federico.chaves

As per your query, do you want to AE to wait till the events is completed?

Or do you want to use error handling if the events gets failed?

---

<div class="post-metadata">

**Author:** ![Federico.chaves](https://avatars.discourse-cdn.com/v4/letter/f/b3f665/32.png) [@Federico.chaves](https://community.automationedge.com/u/Federico.chaves)\
**Post date:** [October 6, 2021, 10:16pm UTC](https://community.automationedge.com/t/gui-automation-wait-for-any-of-two-events/4876/3 "2021-10-06T22:16:23Z")

</div>

Hello,

i want to wait until any of these two events happen.

---

<div class="post-metadata">

**Author:** ![Garr14](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.automationedge.com/garr14/32/824_2.png) [@Garr14](https://community.automationedge.com/u/Garr14)\
**Post date:** [October 7, 2021, 7:55pm UTC](https://community.automationedge.com/t/gui-automation-wait-for-any-of-two-events/4876/4 "2021-10-07T19:55:34Z")

</div>

Hello @Federico.chaves

You can use Plugin “Web wait Until” and use Element Present or Alert Present in condition for both events.

![image](https://canada1.discourse-cdn.com/flex027/uploads/automationedge/original/2X/e/e08c41aab8dfc20b0c7fb2f686d32ef39a2f61dc.png)

---

<div class="post-metadata">

**Author:** ![Federico.chaves](https://avatars.discourse-cdn.com/v4/letter/f/b3f665/32.png) [@Federico.chaves](https://community.automationedge.com/u/Federico.chaves)\
**Post date:** [October 7, 2021, 8:22pm UTC](https://community.automationedge.com/t/gui-automation-wait-for-any-of-two-events/4876/5 "2021-10-07T20:22:24Z")

</div>

Hello,

Thanks for your kind answer.

As any of the two events can happen, should i use a copy rows so there is a row in each “wait” plugin? If so, how do i “cancel” the row that is on the event that didn’t happen?

---

<div class="post-metadata">

**Author:** ![Garr14](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.automationedge.com/garr14/32/824_2.png) [@Garr14](https://community.automationedge.com/u/Garr14)\
**Post date:** [October 8, 2021, 3:00am UTC](https://community.automationedge.com/t/gui-automation-wait-for-any-of-two-events/4876/6 "2021-10-08T03:00:39Z")

</div>

You can use Filter rows and set a condition for the event that didnt happen so as you can cancel the further steps.
