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.
This should work for at least one popup.
Could you please describe your issue exactly ?
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.
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…
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
Does something like this would work?
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,
Every sec or a time very less than for-each activities delay - It should check for the popup (Infinite Loop)
Handle the popup immediately if identified & Repeat
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.
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?
What exactly do you mean with pick Branch ?
Here is the boiler plate for the parallel approach.
HandleRandomPopup Boilerplate UiPath - nmnithinkrishna (2.8 KB)
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
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.
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.