TestCaseNode.Current.Status not reset on each iteration

Bug reports.
krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

TestCaseNode.Current.Status not reset on each iteration

Post by krstcs » Thu Mar 23, 2017 3:13 pm

Ranorex 6.2.1
Windows 10 1607

TestCaseNode.Current.Status is not being reset when a new iteration starts. If you have Error Behavior set to "Continue with Iteration", and the previous iteration failed, then all subsequent iterations will also be shown as failing.

Either we need a way to get the current iteration's (not test case's) status, or the status of the test case needs to be reset when a new iteration starts (the expected result).

I've attached a demo solution. The second module in the test case just prints "TestCaseNode.Current.Status" to the log. The first iteration passes, the second fails, the third passes, but the third iteration's "TestCaseNode.Current.Status" still shows "Failed" even though the iteration itself passed.
Attachments
TestCaseNodeBugDemo.zip
(14.01 KiB) Downloaded 38 times
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: TestCaseNode.Current.Status not reset on each iteration

Post by Support Team » Fri Mar 24, 2017 2:01 pm

Hi krstcs,

The observed behavior is actually intended since the test case self has a “failed” status when one iteration failed.
If you want to get the status of your current iteration you can use the following line
Ranorex.Core.Reporting.TestReport.CurrentTestIterationActivity.Status
Regards,
Markus (S)
.
Image

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

Re: TestCaseNode.Current.Status not reset on each iteration

Post by krstcs » Fri Mar 24, 2017 2:03 pm

Thank you, Markus! Works like a charm.
Shortcuts usually aren't...