Do an action IF tests fail

Best practices, code snippets for common functionality, examples, and guidelines.
lukeclewlow
Posts: 3
Joined: Thu Dec 08, 2016 4:52 pm

Do an action IF tests fail

Post by lukeclewlow » Tue Jul 04, 2017 5:14 pm

Hi there,

I'm running Ranorex to test our website remotely as part of our build process and I need to be able to know that the browser is not open when we start the tests. When tests fail midway through, however, the browser does not close as the last step in the automated test is always closing the browser.

Is there a way to have a test step which is always run if other tests fail, so that I can know that at the end the browser will be closed or should I be doing this externally from Ranorex?

Trying to work out how people generally tend to deal with these sorts of situations.

Thanks in advance for any help anyone can offer :)

Luke

User avatar
qwertzu
Posts: 284
Joined: Wed Jan 25, 2017 11:08 am

Re: Do an action IF tests fail

Post by qwertzu » Wed Jul 05, 2017 2:06 pm

Hi lukeclewlew,

You could simply add a teardown section containing a close application action, that closes the browser.
All actions within a teardown section will be executed even if your test fails.
Please find more information under the following link: https://www.ranorex.com/help/latest/les ... ownregions

regards,
qwertzu