RepeatForever True on OnElementAppear

Hi all,

I was trying to use OnElementAppear event to close a pop-up message in one side of a parallel activity to click OK on a pop-up that will appear while clicking several text boxes on an application page. In the other side of the parallel activity, I have the click activities.I kept the RepeatForever as “True”.But the problem was the robot was handling all the pop-ups but the control got hanged at the end of the parallel activity so the robot didnt proceed to the rest of the work flow after parallel activity. How to make it go to the rest of the automation? My project is massive and even few projects are there in the solution.Do I have to include the main sequence of the main project in one side of a parallel activity and the click on the pop up in the other side?


Hi @Asiri,
I think that this RepeatForever is messing here. It is still repeating in this parallel activity so the activity never ends. I’m just guessing.

I’ll make it simple, lets say we are building a work flow on an application which got 10 screens.Robot will copy data from other applications.Robot is starting from screen one and keep selecting the next page from the menu.In screen 5, for each text field, when robot copies data, there can be a particular popup appearing depending on the quality of data.So rather than checking if the popup is created after every Type into activity, is there any other way that we can close that pop-up by using OnElementAppear and may be parallel activity?because the same pop-up is appearing every time.

I tried to use a parallel activity and included all the steps on screen 5 on one side and OnElementAppear and click activity on the other side and made OnElementAppear RepeatForever true.It actually clicked on all the pop-ups.But got stuck after finishing all the tasks on screen 5. Didn’t go to screen 6

I am trying to compare development with Pega Robotics here.I have experience on that tool and its very easy to keep listening to any pop-up and handle it using one work flow, rather than handling it in multiple places. Event don’t need to know which places it is getting created in the flow.


Hello @Asiri
if possible can you upload your xaml…

Hi AkshaySandhu,

Will not be able to copy the same work flow since its a POV for one our clients.But will create a workflow same as that and copy it here soon.


That will be great…
meanwhile you can have look into attached xaml…
it will give you a rough idea how your xaml should look
zzzTest.xaml (15.0 KB)

1 Like

Hi AkshaySandhu,

This work flow you shared does things in parallel.But I am trying to achieve something more.Please refer the attached .xaml to check what I am trying to do.Also extract the file for the application exe I am using in the workflow. But the click activity only click on the popup once.I am expecting it to close all the popups.Is there any other approach?In UiPath, how we can use Threads? (17.3 KB)

CheersMain.xaml (11.2 KB)

if you gone through my xaml you will see I kept the close pop sequence in while activity… and while condition is boolean: ProcessCompleted=False…

note: ProcessCompleted will be set to true once the processing is completed… in your case it is completion of page 5 (if I am not wrong) …

1 Like

Hi AkshaySandhu,

Thanks for your answer.I changed my work flow according to your instructions and it handled all the pop-ups but in the end threw an exception.I had to change ContinueOnError to True for button click on pop-up to solve that. Am I doing it correct?Main.xaml (11.0 KB)


in while activity to close the pop… before clicking the msg box check if it is exist or not…

1 Like

Hi Asiri,

You have to use ContinueOnError=True because the Click activity can be executed even after the last Type Into, just before the Assign ProcessComplete=True and there will be no more pop-ups to close. Another case that requires ContinueOnError=True is when it takes more than 1 second (configured timeout for the Click) between two pop-ups.


1 Like


Attached you have two examples on how to use OnElementAppear in a Parallel activity to dismiss random pop-up windows.
DismissPopup_Notepad.xaml (10.9 KB) - Opens Notepad, types a text and then click on Close button. A pop-up is shown asking if we want to save or not.
DismissPopup_DesktopApp.xaml (11.3 KB) - Opens the application uploaded a few messages above - and types into all text boxes and the pop-up is dismissed.

The Parallel activity must be configured with Condition set to “True” which means that once a branch will finish execution (the left side in our case), all other branches (the OnElementAppear in our case) will be canceled. We need that in order to exit the OnElementAppear with RepeatForever = True.
The Condition of the Parallel activity is evaluated every time a branch will finish execution, if the condition is True, all other branches are canceled and the Parallel is finished. If the condition is False, the parallel continue execution other branches, until all branched finish execution.


Thanks a lot Silviu!

1 Like

Thanks AkshaySandhu,

your approach works fine as well.Also found the answer for my initial issue from the Silviu’s examples.

1 Like

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