Testcase iteration status in teardown

Ranorex Studio, Spy, Recorder, and Driver.
Nucifera
Posts: 3
Joined: Fri Aug 24, 2012 8:44 am

Testcase iteration status in teardown

Post by Nucifera » Fri Aug 24, 2012 9:21 am

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!

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

Re: Testcase iteration status in teardown

Post by Support Team » Fri Aug 24, 2012 2:04 pm

Hi,

Which Ranorex version are you using?

Regards,
Markus
Ranorex Support Team

Nucifera
Posts: 3
Joined: Fri Aug 24, 2012 8:44 am

Re: Testcase iteration status in teardown

Post by Nucifera » Thu Aug 30, 2012 11:15 am

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.

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

Re: Testcase iteration status in teardown

Post by Support Team » Fri Aug 31, 2012 2:39 pm

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

Nucifera
Posts: 3
Joined: Fri Aug 24, 2012 8:44 am

Re: Testcase iteration status in teardown

Post by Nucifera » Wed Sep 05, 2012 12:20 pm

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

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

Re: Testcase iteration status in teardown

Post by Support Team » Thu Sep 06, 2012 10:21 am

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

fimo420
Posts: 55
Joined: Wed Jun 20, 2012 9:49 am

Re: Testcase iteration status in teardown

Post by fimo420 » Tue Nov 12, 2013 10:48 am

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?

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

Re: Testcase iteration status in teardown

Post by Support Team » Thu Nov 14, 2013 5:28 pm

Hello fimo420,

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

Regards,
Bernhard

fimo420
Posts: 55
Joined: Wed Jun 20, 2012 9:49 am

Re: Testcase iteration status in teardown

Post by fimo420 » Mon Nov 18, 2013 12:29 pm

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

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

Re: Testcase iteration status in teardown

Post by Support Team » Tue Nov 19, 2013 3:59 pm

Hello fimo420,

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

Regards,
Bernhard