Re Framework: Exception handling inside Process.xaml file

I have a process. xaml file which has five test cases(invoked) inside it.

I have a situation where i need to individually catch the exceptions of each test case and mark that specific test case as pass/fail.

The problem is that the whole process.xaml file is in a try block and if I put the individual test cases in try-catch blocks, the catch block of “process.xaml” file will not work(which should not be the case).

Please help on this scenario

I have a thought of using throw exception inside catch blocks. But, process.xaml catch block needs specific exceptions(for logs) and all the specific exceptions cannot be handled manually using throw exception statements.

Hi @rameshgp43

May I know what sorts of test cases you have here and what type of exceptions are you trying to catch? Is it exceptions like some UI elements not found? or checking for a value in a variable etc. Bit more explanation about what exactly you are trying to catch would be great to think of a solution for your case…

Instead of throwing new exceptions you can use rethrow activity in catch block to “rethrow” original exception to main try-catch. In this way you will keep all informations needed for logs.

1 Like

@rameshgp43 were you able to solve this? I have the same issue