Page 1 of 1

Continue with test if one of validation fails in data driven

Posted: Wed Sep 26, 2012 7:44 pm
by vnet
I have a data driven test cases where I am reading values from a csv file, entering in the text box and then validating the result. This works fine when all my validation passes. But the minute one of the validation fails, test exits and doesn't run the test for remaining values. My question is, lets say I have 4 values to input and even if some of the validation fails, my test should continue running. I tried 'Continue on Fail' option on all the validation steps but it didn't work.

I was doing some digging I found out this topic http://www.ranorex.com/support/user-gui ... ation.html, sadly its for older version and there is no update for newer version.

Re: Continue with test if one of validation fails in data driven

Posted: Thu Sep 27, 2012 4:45 pm
by Support Team
Hi,

"Enable Continue On Fail" should work in this case did you also set the Error Behavior of the Test Case to “Continue with iteration”?

Regards,
Markus
Ranorex Support Team

Re: Continue with test if one of validation fails in data driven

Posted: Thu Sep 27, 2012 5:54 pm
by vnet
Yes tried it and worked :)

Re: Continue with test if one of validation fails in data driven

Posted: Mon Apr 01, 2013 8:32 am
by AutomationTester
Hi,
How can I enable it in code module?

Re: Continue with test if one of validation fails in data driven

Posted: Tue Apr 02, 2013 4:39 pm
by Support Team
Hello,

You could use the following code to set the error behavior of your Test Case:
TestCase myTC = TestCase.Current as TestCase;
myTC.ErrorBehavior = ErrorBehavior.ContinueNextIteration;
Warning:
This is not a supported way to change the error behavior.
It is recommended to set it in the Test Suite.

Regards,
Markus (T)