I understand that handling a “click on the same UI element” uniformly is difficult. That was new to me, so thank you for the clarification.
In that case, would it be possible to design a mechanism where, when an error occurs, the robot first sends the Enter key, and if the error occurs again, it restarts execution from the activity immediately preceding the one where the error occurred?
Sending an Enter key when an error occurs can be done in a Global Exception Handler, and this may help close an unexpected popup if it is still visible. However, this approach is not guaranteed to work in all cases because the popup timing and focus cannot always same and Regarding restarting execution from the activity immediately before the error: this is not supported in UiPath. Once an exception is thrown, the workflow cannot resume from a specific previous activity. UiPath does not provide a built-in mechanism to step back and continue execution from that point.
You can try this approach
1 Use Retry Scope or loop-based retry logic around critical UI actions.
2 Break the workflow into smaller, well-defined sequences so they can be safely retried.
3 Use the Global Exception Handler only for generic recovery actions closing popups, logging, cleanup and then restart the process or the current transaction, not a single activity.
I had previously understood Try Catch as something applied to individual activities, and the Global Handler as something similar to a Try Catch applied to the entire workflow. However, I now clearly understand that the Global Handler is more suitable for determining recovery actions rather than performing detailed UI recovery itself.
It seems that the behavior I had in mind would be difficult to achieve using a Global Handler, so I will try a different approach.
This was very informative. Thank you very much for your helpful response.