How to manage an unexpected window?




We will use UiPath to automate application processes and we want to manage the case when an unexpected window appears (information, login error… etc).
We don’t know anything about this window as it is unexpected so we can’t use a selector to find it.

How can we detect this unexpected window and launch a specific process in this case ?

Thanks and regards



Thank you for your inquiry.

For this case I suggest you to Map the process carefully, I think the only need here is a deep comprehension of the system you are using, for instance if there is a message that pops up it means that there is a trigger, find the trigger.

if there is no way to find the trigger(s) what is more important is the type of messages you will encounter, this way you will be able to resolve the exception with try catch statements for instance, no matter at what point you find the window.

I realized that is good to draw the solution as if it will fail and repeat it a couple of times, I think this a great opportunity for your and your team to learn a good lesson.

let us know if you have further questions.

Happy automation :sunglasses:



We would want to use UiPath on some really critical process and thus we would want to prevent all possible cases, even unexepected ones.
It is quite simple to manage pop ups that we know the application could display, but we also want to manage the others.
There is no other solution in UiPath than waiting for an exception and catch it ?



The TryCatch activity might be what you need. It can catch any type of error and take certain measures that you choose. Or it can take different actions based on the type of error it encountered, so you can take even more specific steps in solving the error.

But a good method of improving unexpected behaviour is to use a semi-automated learning:

  1. set up the try-catch with various catches for the exceptions that you know of.
  2. for all the others, set up a sequence that takes a screenshot and saves it somewhere for later reference; or sends it by email or whatever. So you can then improve how your automation reacts to those errors.


Running a process in parallel that closes unexpected popups might work… as in here


  • this will add an extra load because that background process will check continuously for pop-up windows using element exists activity
  • are you sure you want to do that…some errors worth having?


Now, I’m intrigued, is the any way you can explain to us the process? just high level and what the unexpected pop up looks like,

  • To be honest, as @Cosin explained try catch is the best practice for this type of cases.-

I wll be more than glad to help if you will.