Page 1 of 1

Error Behavior-Continue with Iteration

Posted: Mon Dec 01, 2014 6:24 pm
by verm
I have a user code module that runs Validate.AreEqual in a for loop and I want it to run through the entire loop and then report successes/failures at the end, so I set the error behavior to continue with iteration and enabled continue on fail in the recording but the test still stops on the first error. Am I missing something? Or is there a work around for this?

Re: Error Behavior-Continue with Iteration

Posted: Tue Dec 02, 2014 11:34 am
by Support Team
Hello verm,

I’m not exactly sure how your code looks like, but you could use following code in order to report failure and success messages.
for(int i = 0; i<3 ;i++)
			{
				Validate.AreEqual(a,b,"MyValidation", false);
			}
This validation will not throw an exception. Therefore, the iteration of the loop continues even if the validation fails.

Validate.AreEqual()

Regards,
Robert