Action on failing

Ask general questions here.
Anastasiia
Posts: 3
Joined: Wed Jul 23, 2014 2:19 pm

Action on failing

Post by Anastasiia » Wed Jul 23, 2014 2:24 pm

I have a web tests. At the start of test Ranorex opens web browser and at the end closes. But if test is failed browser will not be closed, next test will open another instance of browser and so on.. Is it possible in Ranorex to add action that closes browser (or do anything else) even if test is failed?

mzperix
Posts: 137
Joined: Fri Apr 06, 2012 12:19 pm

Re: Action on failing

Post by mzperix » Thu Jul 24, 2014 8:07 am

Hi Anastasiia,

yes, it is possible :) Just right click on the module and select Teardown. See guide for more information: http://www.ranorex.com/support/user-gui ... html#c3003

Best Regards,
Zoltan

Anastasiia
Posts: 3
Joined: Wed Jul 23, 2014 2:19 pm

Re: Action on failing

Post by Anastasiia » Fri Jul 25, 2014 10:03 am

mzperix wrote:Hi Anastasiia,

yes, it is possible :) Just right click on the module and select Teardown.

Best Regards,
Zoltan
Hi, Zolotan!
Problem in using Teardown is that it is separate recording module. My browser closes using ProcID variable: when I open browser ProceID is saved in specific variable and when closing browser I use this variable:

Code: Select all

Host.Local.KillApplication(ProcID)
As I understand concept of Ranorex modules, they did not share variables, so I can't say to separate module which app should be closed..

mzperix
Posts: 137
Joined: Fri Apr 06, 2012 12:19 pm

Re: Action on failing

Post by mzperix » Fri Jul 25, 2014 11:41 am

Hi Anastasiia,

You can use a global variable to store the actual ProcID. You can connect the variables in the TestCase Variable Binding interface. In the testcase, you have to use a module in a setup region that opens the browser and sets the ProcID. And In the teardown region you can use the ProcID to kill the browser.


Realted guide on binding global parameters with module variables: http://www.ranorex.com/support/user-gui ... html#c2985

Hope this helps,
Zoltan

Anastasiia
Posts: 3
Joined: Wed Jul 23, 2014 2:19 pm

Re: Action on failing

Post by Anastasiia » Mon Jul 28, 2014 12:23 pm

Thank you! Will try to do it)