On element appear - why is the default for the property RepeatForever TRUE

So from the title you can see what I’m asking why would the default for on Element Appear (property Repeat Forever) be set to true.

I would use it to let the workflow wait for some element to appear (lets say webpage is loading and when the specified element has appeared you know you can move on).

The repeat forever property has tripped me up a couple of times sending the workflow into an infinite loop.

I’m not sure what situation you would want to use the on element appear and have it just keep testing that constantly. Could someone give me an example so I can understand please, and does anyone agree that the default should be False (as it’s most common useage would be to put a simple delay into a workflow to wait until something is fully loaded).

I appreciate I may not know what I’m talking about could someone please educate me. Many thanks,

2 Likes

Seems like it’s been tackled quite a while ago with no change so far:

2 Likes

Well spotted @loginerror hopefully another post might bring this to someones attention (if it’s been forgotten about, also the more posts about the subject the easier it will be to find when you are wasting time trying to narrow down your issue to the on element appear activity and then trying to figure out why it’s not working if you’ve never encountered this problem before, it didn’t use to be a high priority, in terms of debugging to me that the default properties might be an issue, now it’s up there with incorrect selector choice).

I’d be interested if someone could give me an example of when you would want it to be true.

The reason that Repeat Forever is set to True as the default is that the main functionality of OnElementAppear or any monitoring activity is to monitor something. For example, you may have a pop-up that occurs at any point during a process, you can put an OnElementAppear with a close pop up in parallel to your process.

The best method to achieve what you are trying to achieve, is to use Find Element and if you need it to last with a long timeout and it will continue once the element is found.

3 Likes

Hi Sam,

Parallelising the workflow is something I haven’t used much (I don’t think there are any examples of this in any of the training material, although I may be wrong). Are there any examples to look at. I agree that it would be very useful to have that ability if a popup could appear at any point in a process with the same selector to close it down (but it’s probably popped up for a reason so presumably it should be handled in some way rather than just dismissed?).

Another question is that you said to use ‘Find Element’. I’ve always used element exists as it returns a Boolean when the element is available (if within the time allowed, then use an if to determine what path to take depending on if the item was found) Find Element appears to return a UiElement variable, I’m not sure how this can be used do you have any examples of this please.

@samuelmongeau

Hi,

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?

Cheers!

For me that is not the most used function of it, but rather to check if a webpage is loaded, a login was succesful, or some pop-up error message that need to be ‘checked’ before continueing.

I agree with the post, default should be false.

It is really annoying at first that it’s True by default. (Until I learned it tripped me too few times)

How about switching to use “Check App State”? To me it seems perfect for those kind of situations.