Can you handle a pop-up during another process is running?

Hi guys,

Is there a way to close a pop-up(warning window) during a for each loop is executing? So in my case I am entering some data (for each loop on the right). While I do that, I want to check for pop-ups or any warning that would appear during that process. I have tried with Parallel operation, so I am checking if something pops-up with element appear, and if it does I want to close down the pop-up window. To my disappointment it does not work.

1 Like

Hey @Martin_Freser

This should work for at least one popup.

Could you please describe your issue exactly ?

Thanks
#nK

When the pop up appears my for each loop still continues to the next uielement, which breaks my robot. The pop up is not getting closed, so there are uielemts under it.

1 Like

Okay so you mean your for-each should wait for the popup to close before performing next action?

And is the step where the popup occurs is it fixed…

Thanks
#nK

yes exactly the for each should wait for the windows to close and than continue executing once the pop up is closed. No the pop up can appear randomly

1 Like

Hello @Martin_Freser!

Does something like this would work?

Okay @Martin_Freser

You may use two approaches here,

1. Global Exception Handler - Whenever there is an error, the execution flow will navigate to the handler & you can handle the popup and continue the execution

2. Parallel - You are already halfway through it, But still some logic to be implemented.

Your parallel activity to be in such a way that,

  1. Every sec or a time very less than for-each activities delay - It should check for the popup (Infinite Loop)

  2. Handle the popup immediately if identified & Repeat

  3. Mark the parallel condition property as true so that the infinite loop gets terminated as soon as the main for-each with actual business logic comes to an end

This should help.

Thanks
#nK

To add a 3rd:
3. Pick Branch - Use a pick with 2 branches. ONe that finds the popup, one that finds something that appears if no popup comes. I’d prefer this over the parallel, since it will execute the branch that matches and drops all others. This prevents you continiously waiting for a find element on the popup to expire if you’d run it in a parallel flow, where little or no popups appear.

@Nithinkrishna Do you have any example how that would be implemented. So lets say we want to use the parallel option. " 1. Every sec or a time very less than for-each activities delay - It should check for the popup (Infinite Loop)" how would I implement point 1?

1 Like

What exactly do you mean with pick Branch ?

Hey @Martin_Freser

Here is the boiler plate for the parallel approach.

HandleRandomPopup Boilerplate UiPath - nmnithinkrishna (2.8 KB)

Thanks
#nK

Parallel doesn’t work how people think it works. It doesn’t execute all the commands at the same time. It still does them sequentially.

If you need to check for the window every iteration of the loop, put your On Element Appear and If into the For Each Row.

@Nithinkrishna Thanks for the suggestion, but this way it still doesn’t stop the for each from continuing. will try to implement it in the for each as @Angel_Llull and @postwick suggested

2 Likes

Yes @Martin_Freser For each will still continue, that’s why you need to have a 30sec delay or more as needed for the actual activities.

Thanks
#nk

This:

This was the right solution. So When the pop up appeared I navigated the robot to a state from which the for each loop could continue. Logged the error and used the “Workflow->control->contin ue” operation, so the program proceeded to enter other data.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.