Try/Catch not catching Modern UI selector errors for Type Into (EIN field)

Hi everyone,

I am facing a strange issue while typing into an EIN field using Modern UI activities inside a Try/Catch.

Sometimes the Type Into works perfectly, but sometimes UiPath throws this error:

Type Into: Could not find the user-interface (UI) element for this action.

However, when this happens, the workflow does NOT go to the Catch block. Instead, the process stops completely without reaching Catch.

It looks like Modern UI automation is validating the selector before the Try block executes, so the exception is thrown outside Try/Catch.
Because of this:

  • ContinueOnError = False → workflow stops before Try
  • ContinueOnError = True → workflow skips error completely but does NOT enter Catch
  • Try/Catch never gets triggered

I want to understand:

  1. Why does Try/Catch not catch this selector error in Modern UI?
  2. Is UiPath validating selectors before Try starts?
  3. What is the correct best-practice approach to always move control to Catch when Type Into fails?

My goal is simple:
:right_arrow: If the EIN field is not found or not ready, I want the workflow to enter Catch every time.

Attaching screenshots of the activity and error message:

If this happening while debugging, you try enabling Continue on Exception option from Debug menu.

It doesn’t validate until and unless the activity being executed.

I think Continue on Exception option will help you.

It should practically not validate before entering the try block. Selectors are not validated before. May be before this you have some condition due to which it is not getting in try block iteself. Can you re-verify the flow.. Can you share a Screenshot of your xaml or the flow, will check and revert.

Hi @Abhinay_Reddy1
Welcome to UiPath,

You should check the element first with activities like Check App State or Element Exists, and only then perform the Type Into. That way, if the field is missing or not ready, the workflow can handle it properly inside Try Catch. The best practice is to always validate the UI element before acting on it so exceptions are managed consistently.

Happy Automation

I tried that method, but it’s still not working.

I tried that, but I’m still having the same problem.

Can you check if that variable is coming empty. Currentrow(“employer_identification_n…”)..

May be for this its coming empty, and activity is getting executed successfully, so its not going to catch block. Can you check at this point.

@Abhinay_Reddy1

looks like you are running in debug mode..click on continue to move to catch

cheers