How to stop an iteration and continue other iteration by user-code

Best practices, code snippets for common functionality, examples, and guidelines.
appa
Posts: 1
Joined: Mon Mar 27, 2023 3:33 pm

How to stop an iteration and continue other iteration by user-code

Post by appa » Mon Mar 27, 2023 6:16 pm

The script has 5 iteration.
If any iteration failed (an element did not appear because the system turned off it as expected), log a warning message and mark the current iteration as Passed.
After that the script moves to next iteration and continue to test.

I have tried to use:

Code: Select all

throw new ValidationException("text")
But the test result is till Failed.

If I put this code before that code, the test result is Passed

Code: Select all

TestReport.EndTestModule(TestResult.Passed);
However, the order of iteration in test report is not arranged correctly