The For Each UI Element activity works correctly when the workflow is executed in Run mode. However, when executed in Debug mode, it throws the following error:
“[Target]: Could not find the UI element corresponding to this selector:
[1] webctrl id=‘caretsiframe’ tag=‘IFRAME’
[2] webctrl class=‘jspPane’ parentid=‘caretsCont’ tag=‘DIV’
Search failed at selector tag:
[1] webctrl id=‘caretsiframe’ tag=‘IFRAME’
For Each UI Element ‘08152024 MCEXAM Diaz,…’: Could not find the user-interface (UI) element for this action.”
I am looking for the correct approach to resolve this issue.
second are you sure its failing in debug and no error in run? because in run mode even if there is error it would move forward..to confirm in debug click continue and check
also one way is to use check app state before for each ui element
This issue happens because Debug mode changes the timing and focus, causing the UI element (especially inside an IFRAME) to load later than it does in Run mode.
The selector is valid, but Debug mode often pauses before the IFRAME is fully loaded, so the activity cannot find it.