Looping throw a variable number of notifications (no matter which content the notifacations have)

Dear all,

our robot needs to click several times on an “OK-Button” of different notifications.
The problem is, that we do not know how many notifications the robot needs to click and which content is shown in the single notifications.The number and content of the notifications is for each process different.

The only common ground of all notifications is the visual appearance of the “OK-Button”

Is there any solution, that the robot recognizes the “OK-Button” (no matter which content the notification has) and loops throw a variable number of notifications?

We already tried to manipulate the selectors and loop throw the notifications in a “Do While Activity” with the help of a “Element/Image exists” activity.

Thank you very much for your support!
Nico

You’re on the right track using the Do While activity. If you are able to successfully click on the OK button with an activity, then it should be equally possible to check for the existence of the button using an Element Exists activity using the same selector. Use this activity to check for the presence of the OK button, and if it exists, click it. Your While condition will be ElemExists where ElemExists is the boolean variable where you’re storing the output from the Element Exists activity.

This will result in a default wait time of 30 seconds when all dialogs have been exhausted, so if this is too long, adjust the timeout for the Element Exists activity. I generally like to use 5 seconds for quick applications as a balance between stability and speed, but be sure to adjust it as it fits your needs.