Continue within test case

Ask general questions here.
krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Continue within test case

Post by krstcs » Tue Nov 05, 2013 2:27 pm

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.
Shortcuts usually aren't...

Swisside
Posts: 92
Joined: Thu Oct 10, 2013 10:40 am

Re: Continue within test case

Post by Swisside » Wed Nov 06, 2013 4:45 pm

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 !
A simple thank you always does wonders !