ForEach loop not able to find element 2 cycles through the loop


I have now, thanks to some very helpful members, created a process which will get the next report name from the queue, then go to the required website, navigate to the report, save it as a PDF, then loop back to the next report.

This works for 2 reports, but every time at the 3rd report in the sequence it will not be able to find one of the elements - “Open In…”, which is in the “File” dropdown menu. I have checked the selector in UiExplorer and it is the same for the third report as it is for first 2. I have also removed the first 2 reports from the list so it would start at the 3rd report, and it still breaks after 2, ie report #5 will get stuck at the same point.

<webctrl aaname='Open In' parentclass='bi-menu-item menu-item' />

Is there a reason the for each loop gets stuck at this point every time as nothing is changing between reports? I have changed the delay before, and after, to make sure there is adequate time to find it, however this had no effect.

Has anyone else had a similar issue whereby a foreach loop would not be able to process the 3rd item due to a seemingly stable element not being found?

Thanks in advance!

Solved - selector was changing for whatever reason, as IE was slightly changing the drop down menu after 2 cycles (not sure how or why, but I noticed when going through with a fine-tooth comb in UiExplorer).