How to handle random popup

I think the Get Active Window activity should work for this use case. If a timeout exception occurs in try block due to a pop up, you can use Get Active Window activity in the catch block to get the pop up window and pass a Alt+F4 hotkey to close it. Let us know if it worked.

@SajithMohideen

Hello, “alt F4” is not working for my application,

but I want use the "Window.Close ()" for closing unknown popup, let me know how to do in uipath

I was trying to automate using flipkart. When we land on home page of flipkart for first time, we sometimes get popup and sometimes we dont. As per below thread i used element exists and I have put if condition and if popup comes I close pop up and for else condition my rest of the flow follows is this correct approach as Im newbie to UIpath

hey,have you solved this one??? I am also facing the same trouble @ChinnapuReddy

Hi @amithvs

EDIT. I think my answer was not on point. If you’d like to execute a command like that:
Window.Close
you can do so with Invoke Code activity:


image

The new feature of Global Exception Handler might be your answer. It was introduced in the 2018.4 Community Edition. You can find more information here:


and here:
https://studio.uipath.com/v2018.4.0/docs/global-exception-handler

3 Likes

will check this and let you know. Thanx.

@vvaidya
I have a question, in the same scenario if the pop-up appears, on element activity triggers and it clicks close(pop-up) using parallel activity, so what happens after clicking close. Does it resumes with the flow?, suppose if it resumes, how can it moves to other sequence.
Note: We have two sequence in parallel activity, one for clicking pop-ups and another normal workflow

Thanks in Advance

Hey! Did you find a solution for this?
Thanks

Guys, Use Parallel activity , it works in my project which i am currently working.
In parallel activity use your process one side and others as detecting your popup and handling it.

Unfortunately i cannot post the workflow here.

Thanks,
Sri

@kuldip.gohil

You can put the entire sequence in a try catch block.

In the catch block, you can have as many exception boxes as you want and use “Element Exist” activity to find the exception box and using “if” activity, you can handle them.

This way, it doesnt matter at which step you have error, execution will naturally go into the catch block and if the Element exist boolean turns out to be true, the exception will be handled.

Thanks and Regards,
@hacky

1 Like

@hacky
This sounds like a solution but once the control is in exception block how would you pass it back so that rest of the actions can be performed?
I think this will simply handle the exception and move to next workflow.

Hi @manojsinghal134

Welcome to our UiPath Forum! :slight_smile:

It is true that a simple Try-Catch will ‘swallow’ the exception and allow the workflow to continue (which might not be desirable).

Apart from Global Exception Handler for random pop-ups, you can also look at the REFramework concept. It would fail the transaction on an irregularity and then retry it in an environment that was reset to starting values, now hopefully without an issue.

3 Likes

Good morning everyone,

Thank you for the excellent topic here, it really helps clarify certain items in regards to handling random popups, so I was wondering if I could get some guidance on the below:

I have a web application that I am currently using that randomly generates a Session Expired popup which prompts you to enter a username and password in order to continue. This doesn’t happen within minutes or hours but sometimes within seconds. The team responsible for this web application is currently working on it but who knows when they will fix it ( I estimate days if not weeks). In the meanwhile , development work needs to continue so I need to find a way around this popup.
As I mentioned before, this popup sometimes shows back to back within a second and sometimes takes about 30 seconds before it comes along.

1- I tried using a parallel activity where the left hand side is my actual process and the right hand side uses “On Element Appear” activity and enters the credentials when that occurs. The problem is this only works once and when that popup appears again within that same run, it will timeout and fail.

Is there a way to use try/catch/finally or global exception handler in order to have the bot catch that popup window and if it occurs , handle it by entering username and password and then moving on to the next activity that it is supposed to do knowing that we have no idea on when this occurs between activities. It could be the first activity or the 100th activity.

Hey, I might be childishly asking you about these pop-ups, but are these pop-ups ads? If they are ads then simply use an ad-blocker particularly one that blocks pop-ups

Hi sasho,

You need to convert some parts of your Workflow/Sequence into State Machines. Create a state to handle the random pop-ups. Please visit the State Machine links posted below for better understanding

In my opinion, every popup has a pattern. The SAP developers have decided to display the popup based on some conditions, correct? So no popup is random. So, I think if we ask either the SAP developers or the users who know how the system behaves, the popups handling can be more predictable.