Page 1 of 1

Run code at the end of testing

Posted: Tue Sep 06, 2016 1:21 pm
by npanag
I have a project that executes a number of iterations.
One web site calculates some numbers with input data from an Excel file. These numbers are compared to a predefined set of numbers. If the numbers in an iteration are different, a Ranorex.report.error puts a red indicator to this iteration.
The test execution continues and, at the end, some of the iterations have red inidicator and the big circle up and right is green.
What code and in which location of the test can force that if one at least iteration has the Ranorex,report.error raised, then the final big circle up and right to become also red?

Thank you in advance.

Re: Run code at the end of testing

Posted: Tue Sep 06, 2016 3:26 pm
by krstcs
Try using Report.Failure() instead of Report.Error().

Re: Run code at the end of testing

Posted: Tue Sep 06, 2016 4:21 pm
by npanag
Yes, but where do i write it?

If i write it in the user code, it starts until it reaches the Report.Failure() and then stops without iterating the other 5 times. I want all iterations to be done and after the last iteration to run the Report.Failure (if some conditions exist).
Where must i write it?

Re: Run code at the end of testing

Posted: Tue Sep 06, 2016 4:25 pm
by krstcs
Have you set the Error Handling option to "Continue iteration" for the test case?

Re: Run code at the end of testing

Posted: Wed Sep 07, 2016 12:20 pm
by npanag
Yes it worked with changing the Error behavior to "Continue with iteration" and putting in the code the Report.Failure command that influenced the final big circle result. Now for example, in 3 only successful iteration in a total of 6, the final circle is half in green and half in red referring that 3 iterations succeeded and 3 failed.
Thank you.