I am trying out the For Each UI Element activity.
I am trying to iterate through each page in this website:
“All reports | Experian plc”
and click on the Download(PDF *) button on the item that has the label " Annual Report 2024".
This is the screenshot of my activity:
I am applying the following filter:
This is how the config of the For each UI element looks like:
Pagination_Old.xaml (86.1 KB)
The error that I am getting:
For Each UI Element: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter ‘index’)
I am getting this error even when I have nothing inside For Each UI Element activity. This is the full stack trace:
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter ‘index’) at System.Collections.Generic.List
1.RemoveAt(Int32 index) at UiPath.UIAutomationNext.Activities.Helpers.UiNodeInfoEnumerator.ExtractPageDataAsync(IUiNodeX target, DataTable dataTable, String metadata, TimeoutToken timeoutToken, Int32 processedRows) at UiPath.UIAutomationNext.Activities.Helpers.UiNodeInfoEnumerator.ExtractToDataTableAsync(CancellationToken token, Int32 processedRows) at UiPath.UIAutomationNext.Activities.Helpers.UiNodeInfoEnumerator.ExtractToDataTableAsync(CancellationToken token, Int32 processedRows) at UiPath.UIAutomationNext.Activities.Helpers.UiNodeInfoEnumerator.GetNextPageAsync(CancellationToken token) at UiPath.UIAutomationNext.Activities.Helpers.UiNodeInfoEnumerator.MoveNext() at UiPath.Shared.Activities.Business.ForEachEnumeratorExtensions.IterateAndReturnIfActionExecuted[T](Variable
1 enumeratorVariable, NativeActivityContext context, ActivityInstance completedInstance, Boolean exitLoop, Action1 doAction, Action
1 completedAction, Action1 exitAction) at UiPath.Shared.Activities.Business.ForEachEnumeratorExtensions.Iterate[T](Variable
1 enumeratorVariable, NativeActivityContext context, ActivityInstance completedInstance, Boolean exitLoop, Action1 doAction, Action
1 completedAction, Action`1 exitAction)
at UiPath.UIAutomationNext.Activities.NForEachUiElement.ExecuteForEach(NativeActivityContext context, ActivityInstance completedInstance)
at System.Activities.Runtime.CompletionCallbackWrapper.CompletionWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
— End of stack trace from previous location —
at UiPath.UIAutomationNext.Activities.NApplicationCard.OnFault(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.FaultWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
What I observe, is that the code runs, and the pages are iterated through until page 6 after which, this error is thrown.
Kindly assist to solve the error. Thank you.