How to handle random popup

ok… Thanks :slight_smile:

Have you tried using continue on error?

many TryCatch, not really, I think more like, since I had the same synthom when somebody else connect to the webpage to download invoices, I was downloading an invoice lets say IP0001, then on the P1002 the pop up appears, what I did is a try catch. try to download invoice P1002 and if there’s any error click the popup and “end” the process, now, outside the try catch What I had it was an state machine to read in a config file which invoices the robot was able to download and put a log on a certain row, and then since the process stoped on P1002 this row would not have the log, so it will start from there again.

What do you think, I guess I can send you the XAML for your reference if you have doubts on how to implement this. :slight_smile:

Continue on error for every element is also not a good option. Because If flow will continue on error then it will not do work what I indent to do.

Thanks @beesheep I understood your scenario and I’ve implemented try catch at few places, but my situation is popup randomly comes in between the activity I am doing hundreds of activity

My situation can be solved if I do below

  • If i create one workflow to close popup if its available and include between every activity.

e.g.

  • Inovke Popup close workflow
  • Activity 1. e.g. Click on element
  • Invoke Polpup Close Workflow
  • Activity 2. Type text
  • Invoke Popup Close Workflow
  • Activity N…
2 Likes

first add “image exists” then assign a variable to it and then use decision flow activity, in “image exists” give the image of popup, and in the decision flow , in true part use click activity (to close the popup). try this and it should work. :slight_smile:


@yashvardhan_singh - This approach can work if popup 's pattern is fixed, in my case popup can come in between of screen any time.

Hi @badita,

Would you know if @uipath is planning to implement the “PopupScope” activity you mentioned here?

2 Likes

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

1 Like

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

1 Like

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