Forum Discussion

william_roe's avatar
william_roe
Super Contributor
9 years ago
Solved

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.

     

4 Replies

    • william_roe's avatar
      william_roe
      Super Contributor

      NisHera wrote:

      Did you check this?

      I mean project palyback options


      As best I can tell 'stop on error' is disabled for the suite, project, and test item yet the Runner.Stop(true) statement in the 'GeneralEvents_OnLogError' doesn't move to the next item and the test run stops. I wonder if the test must be run from the suite in order for this to work. I'll try this next.

      • soccerjo's avatar
        soccerjo
        Occasional Contributor

        How are you starting the test run? Are you clicking the green start arrow when the first test in your list is highlighted, or when the folder that contains all of your tests is highlighted?