Catch Errors

Ranorex Studio, Spy, Recorder, and Driver.
Timo
Posts: 2
Joined: Fri Nov 18, 2016 2:11 pm

Catch Errors

Post by Timo » Fri Nov 18, 2016 2:47 pm

Hi,

I'm looking for a way to catch an Error ON TESTCASE-LEVEL (on module Level there ist something like continue on fail). Some further Information: a have a Testsuite (created with Ranorex GUI). The Suite contains a Testcase thats calls a Recording module wich Fails with an Error because of a missing component. And dont want this Error to be registered (not added to protocoll no test termination). Similar like catching an Exception on Code Level. Silently ignore this error thrown. I want to do such stuff beacuse: every GUI Action in our Application is already coverd by recording modules. Our Automatisation Project had been finished so far. Now our customer asked for testing negative cases when the user lacks permissions to do someting. So I want to simply reuse the undrets of existing recordings and simply ignore the thrown Error (when the permission denied Dialog blocks the sequenz) and then check for the permission denied Box shown. But cannot find a way to say Ranorex to ignore this Error. I already thought to write a wrapper in c# that could call recording modules but I have not much experience with Ranorex API.

Has anyone an Idea how to solve this ?

asdf
Posts: 174
Joined: Mon Mar 21, 2016 3:16 pm

Re: Catch Errors

Post by asdf » Mon Nov 21, 2016 2:43 pm

Hi Timo,

Have you tried to set the error behavior of your test cases to "Continue with..."
Therefore, right-click on your TestCase and choose the right error behavior.
ErrorBehavior.png
You could also change the error behavior for a single action.
Right-click on the action, and choose "Enable Continue on Fail".
ContinueOnFail.png
I hope this helps.

Sincerely,
asdf
You do not have the required permissions to view the files attached to this post.

Timo
Posts: 2
Joined: Fri Nov 18, 2016 2:11 pm

Re: Catch Errors

Post by Timo » Wed Nov 30, 2016 2:23 pm

Hi asdf,

thanks for your reply, but i have to reuse testcases without changing them, so im not allowed to Change recordings. Something like "continue on fail" that can be enabled by clicking right mouse button on a TESTCASE would be great not on an action. Its a bit complicated. We have thausends of existing Recording for positive cases (user clicks, everthing wents fine). But now a have to test whast happens when a user tries to click exact the same sequences but the user lacks permissions. So dont want to rewrite every recording. Reuse it, after some click a permission denied Dialog appears but it correct, but i dont wanna to log this as an error.

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Catch Errors

Post by krstcs » Wed Nov 30, 2016 3:06 pm

But, that is NOT the same test case. You are testing two different cases, one with positive outcome, one with negative. These are DIFFERENT, and you should not use the same test case for both.

The point of the test case is that it is for one specific path through the logic with one expected result. You are trying to use one case for two paths.

You should make a new test case instead.

Also, if you have portions of your business logic that are always the same, regardless of the positive/negative test case outcome, you can create module groups with the correlating modules and then reuse the group in any test case where you need that flow. This is the best and most appropriate way to reuse flow logic.
Shortcuts usually aren't...