Page 2 of 2

Re: Continue within test case

Posted: Tue Nov 05, 2013 2:27 pm
by krstcs
If you do what I suggested and put your user code modules in their own sub-test cases, you can do this at the sub-test case level and it will work as you are wanting.

Re: Continue within test case

Posted: Wed Nov 06, 2013 4:45 pm
by Swisside
Hello !

I tried setting a particular action of a Record to "Enable continue on fail". Then I right clicked it and went to the code which looked like this :
try {
                Report.Log(ReportLevel.Info, "Keyboard", "(Optional Action)\r\nKey sequence '{Tab}'.", new RecordItemIndex(4));
                Keyboard.Press("{Tab}");
                Delay.Milliseconds(0);
            } catch(Exception ex) { Report.Warn("(Optional Action) " + ex.Message); }
I'm pretty sure you could go to your Code Module and do something like
try {
//Paste the actions you want optional
} catch(Exception ex) { Report.Warn("(Optional Action) " + ex.Message); }
Regards


EDIT: Just tried it. It works

Example :
Mouse.DefaultMoveTime = 300;
			Keyboard.DefaultKeyPressTime = 100;
			Delay.SpeedFactor = 1.0;
			
			
			try {
				repo.MyNonAccessibleElement.Self.Click(); //try to click on a non accessible UI element
			} catch(Exception ex) { Report.Warn("(Optional Action) " + ex.Message); }
			
			Report.Log(ReportLevel.Success,"Test"); //This is reported ! Great !