Try Catch Exception

Hello Everyone,
right now i am working on exception handling

  • this is my try block in this i invoke workflow

  • this my catch block

readwebdata file have many activity which i have to perform
i user try catch block for selector not found but that is not working properly

Thanks…

For me the best practice regarding Try Catch is to select a general exception like System.Exception and not a particular one as yours.

In the catch field you can use Log message or Write line activity instead of Message box because Log message will not pause your program in case of any errors. In the text field of Log message you can write something like that:

"Error: " + exception.Message + " at activity: " + exception.Source

Hope that will help you.
Regards

2 Likes

hey @VladTof
Same error occurred

@Urvin_Sanghavi

please check the type of browser selected,if it is okay use UIExplorer indicate the element and match the selectors.

Regards,
A Manohar

hey @Manohar1
if my selector is not match then this action go to catch block right?
that action is not goinig to catch block and that i want to do if selector not found then go to catch

@Urvin_Sanghavi

It will surely must go the catch block if an exception presents in try,if not try to set True for continue on error in properties panel.

Hope this will works.

Hey @Manohar1
you are not understand what i wan to do is simple if selector is not found then go to catch block. that i want to do norma try catch block.

@Urvin_Sanghavi

can you please share your xaml.

Yaaa sure.Main.xaml (23.2 KB)

It’s exactly what it does.
“Selector is not found” means that an error will be thrown and Catch block will be executed.

but in my cash cache block is not excuse.

I think you said that catch block was not executed.
Please change the exception from SelectorNotFoundException in System.Exception and run again.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.