Try catch clarification

Hi Everyone,

I need to show a message box as “Uipath could not identify an element in the process. Please contact development team” when uipath not able to find the selector. I am using a condition to identify if exception has words like “Cannot find an element” and then printing but actually it comes under Selectornotfoundexception category. How to show the message by identifying the exception type.

Thanks,
Ulaga

1 Like

Click on “Exception” then you will be able to select the type of exception you need to catch

1 Like

Add the SelectorNotFoundException as a catch, like @farhan94 showed. Then inside the Catch block add a Throw activity with the following:
new UiPath.Core.SelectorNotFoundException("Uipath could not identify an element in the process. Please contact development team.")

1 Like

@evangemert and @farhan94 Thank you. I am using only one catch block in my project. Is it possible to implement the above concept using some condition or need to use multiple catch option?

@Boopathi Attached File is having wrong selectors so it waits for 30 seconds and display message which you required

Main.xaml (7.4 KB)

1 Like

Thank you @Indra.

1 Like