william_roe
9 years agoSuper Contributor
Continue to Next Item from 'OnLogError' Event
How do I continue to the next item upon error?
Stop on error in the project properties = false
I've Tried the following for 'Stop on Error' for the Test Item to (same result - test ends):
- None
- Project
- Test Item
function GeneralEvents_OnLogError(Sender, LogParams){ if(Project.Variables.EnableEmailNotification == true){ if(Project.TestItems.Current != null) var body = "Test:" + Project.TestItems.Current.Name + "\r" + "Message: " + LogParams.MessageText + "\r" + "Additional Text:" + LogParams.AdditionalText; else var body = "Message: " + LogParams.MessageText + "\r" + "Additional Text:" + LogParams.AdditionalText; SendMail(Project.Variables.MailRecipientList, "internalrelay.americas.swk.pri", "Automated Test (" + ProjectName() + ") Failed", "donotreply@sbdinc.com", "Automated Test Failed (CMWeb)", body); }
Runner.Stop(true); }
The Runner.Stop command causes the the test to end.
I've even made sure the 'Stop on error' is disabled at the suite level.
You question helped me solve the problem. If I launch from 'Open All Pages / Reports / Dashboard' the Runner.Stop(true) works as I was expecting. I was launching the 'Open All Pages' and it wasn't working. Thanks for the reply.