Page 1 of 1

Testcase iteration status in teardown

Posted: Fri Aug 24, 2012 9:21 am
by Nucifera
Hi,

I am using something like that in my teardown module to react on failed testcases only:

if (Ranorex.Core.Testing.TestCase.Current.Status.Equals(Ranorex.Core.Reporting.ActivityStatus.Failed))
{
// do something
}

This works fine on standard testcases. But inside iterations, the ActivityStatus of the current testcase is always "Active", so I cannot distinguish between failed and succeeded testcase iteration.
Is there a different status I have to use to find out the Iteration status instead of the TestCase status?

Thanks!

Re: Testcase iteration status in teardown

Posted: Fri Aug 24, 2012 2:04 pm
by Support Team
Hi,

Which Ranorex version are you using?

Regards,
Markus
Ranorex Support Team

Re: Testcase iteration status in teardown

Posted: Thu Aug 30, 2012 11:15 am
by Nucifera
I am using version 3.3.1.
Based on the release notes:
The result of a test case iteration can now be evaluated within teardown modules
I thought this would work.

Re: Testcase iteration status in teardown

Posted: Fri Aug 31, 2012 2:39 pm
by Support Team
Hello,

Ranorex 3.3.2 is now available.
Please update Ranorex to 3.3.2 and try it again.
It should work now.

Regards,
Bernhard
Ranorex Support Team

Re: Testcase iteration status in teardown

Posted: Wed Sep 05, 2012 12:20 pm
by Nucifera
Hi,

thanks for the tip, installed 3.3.2 and now it's working.
Unfortunately, I misinterpreted the workflow.
TestCase.Current.Status is always "Failed" as soon as one Iteration failed. Which means I cannot distinguish between a failed and successful iteration in the teardown this way.
Is there something similar to TestCase.Current.Iteration.Current.Status?

Thanks again

Re: Testcase iteration status in teardown

Posted: Thu Sep 06, 2012 10:21 am
by Support Team
Hello,

Unfortunately there is no possibility to check the state of the current iteration of a test case at the moment. We will add this feature in one of our next releases.

Regards,
Bernhard
Ranorex Support Team

Re: Testcase iteration status in teardown

Posted: Tue Nov 12, 2013 10:48 am
by fimo420
Hi,

Bringing up old topic, was just wondering if there are any such feature as nucifera was talking about now in ranorex?
TestCase.Current.Iteration.Current.Status?
Find out status of the current iteration in ranorex?

Re: Testcase iteration status in teardown

Posted: Thu Nov 14, 2013 5:28 pm
by Support Team
Hello fimo420,

Please read the forum thread "Teardown and continue with iteration".

Regards,
Bernhard

Re: Testcase iteration status in teardown

Posted: Mon Nov 18, 2013 12:29 pm
by fimo420
Hi Bernhard,

Thanks for helping.
Can you tell me one thing, where do i put this line?

Code: Select all

Ranorex.Core.Reporting.ActivityStack.Current.Parent.Parent.Status.Equals(Ranorex.Core.Reporting.ActivityStatus.Success)
I mean do i create a new module and put it in at the end of it or should it be in program.cs?
I just want to log the result into a file, at the end of all iterations.

Br,
Feroz

Re: Testcase iteration status in teardown

Posted: Tue Nov 19, 2013 3:59 pm
by Support Team
Hello fimo420,

I would create a new module in the TEARDOWN section of the test case.

Regards,
Bernhard