Error Behavior-Continue with Iteration

Class library usage, coding and language questions.
verm
Posts: 4
Joined: Mon Dec 01, 2014 5:04 pm

Error Behavior-Continue with Iteration

Post by verm » Mon Dec 01, 2014 6:24 pm

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?

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

Re: Error Behavior-Continue with Iteration

Post by Support Team » Tue Dec 02, 2014 11:34 am

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
.
Image