Recovery Scenarios

Best practices, code snippets for common functionality, examples, and guidelines.
aumohanraj
Posts: 9
Joined: Mon Jun 06, 2016 10:29 am

Recovery Scenarios

Post by aumohanraj » Sat Jul 02, 2016 5:40 pm

Hi,

Is there any way to call a particular module whenever there is a failure in test step?

I would like to bring my application to certain page(Home Page) whenever the test case is failed. Is there any way to achieve this?

Thanks,
Mohanraj Kesavan

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Recovery Scenarios

Post by Support Team » Mon Jul 04, 2016 9:35 am

Hello Mohanraj Kesavan,

I would highly recommend using a so-called "tear down"-section. This section will be executed whenever the test fails and is used to bring back the application under test to a desired state. Please find further information regarding "SETUP/TEARDOWN"-sections within our user guide: http://www.ranorex.com/support/user-gui ... suite.html

I hope this information helps.

Sincerely,
Robert

aumohanraj
Posts: 9
Joined: Mon Jun 06, 2016 10:29 am

Re: Recovery Scenarios

Post by aumohanraj » Wed Jul 06, 2016 6:26 am

Hi,

Teardown section will be executed irrespective of the test case status(Pass/Fail). If we bring

Bringing back the application to the desired state after the each test case iteration will take more time. So It would be great if have the feature to call a module whenever the test step fails

Thanks,
Mohanraj Kesavan

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

Re: Recovery Scenarios

Post by krstcs » Wed Jul 06, 2016 3:36 pm

You should use the teardown and include an IF statement in your teardown module that checks for the status of the test (Success, Failed, etc.) and then does whatever you need based on the condition. That is the correct way to handle it. There is no need for another feature.

Also, you can layer the test cases in many different ways to make the test behave in many different ways, depending on what your actual needs are. And each one has a setup/teardown.
Shortcuts usually aren't...