Is it possible to go back to a previous activity or sequence?
I have an IF condition which check the results of my Element Exists. If the condition is True then I want it to move to the next activity but ELSE I want it to first set a Delay activity, and then move back to the Element Exists before the IF condition (so loop back and recheck the element)
Surely this must be possible somehow? I am not using Flowchart, just Sequences.
It is good to use loop for recheck and execution of some steps but their might be some issues as well.
Like if you will check Element Exists inside any looping construct and by setting flags you will set the loop running condition. So suppose Due to site changes or in case of sectors will fail then loop can go to infinite run.
There is one option to use Retry Scope because here you can pass the number of retries so even if nothing will work instead of to stuck on the infinite loop it will either terminate or gracefully stop the termination or will perform rest steps depended on your workflow logic.
Even with loop you can do this to check for particular count by maintaining the counter because when you are processing huge records then just because of one error with record you can not wait for it to complete. best thing you can skip it with an error log and process next items.
So if it is like you are saying, then I dont even need a Delay timer activity in the Action box? I can just add the activity that I want it to run/try? Like the way I have done in the screenshot attached. I even have the RetryInterval set to 10 seconds.
This doesn’t work though, it throws an error because it’s trying to click the Export button before the page has fully loaded.
Message: Cannot find the UI element corresponding to this selector:
Exception Type: SelectorNotFoundException
UiPath.Core.SelectorNotFoundException: Cannot find the UI element corresponding to this selector: —> System.Runtime.InteropServices.COMException: Cannot find the UI element corresponding to this selector:
at UiPath.UiNodeClass.FindFirst(UiFindScope scope, String nodeID)
at UiPath.Core.UiElement.FindFirst(FindScope scope, Selector selector)
— End of inner exception stack trace —
at UiPath.Core.Activities.ScopeActivity.OnFaulted(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.Invoke(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.FaultWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
This didn’t work because click event is occurring before you are testing if the element exists. You can get around a few ways the cleanest IMO is set the condition to continueOnError = true on the click event