Forum Discussion

swaroop's avatar
swaroop
Senior Member
3 years ago
Solved

onStop event runs after every keyword

Hello all,

 

I wanted to know if there is a way for us to start the onStopTest event to be triggered after all the keywords in an execution plan is run. Currently with the below script, we are trying to check the last test item to achieve the same but wanted to see if there is an option to run the event only after the project has been executed and not for every keyword executed.

 

function EventControl1_OnStopTest(Sender)
{
    function GeneralEvents_OnStopTest(Sender)
   {
      if (Project.TestItems.Current.Name == "Test1")
      {
          Log.SaveResultsAs(("File path", lsPackedHTML, true)

          if (SendMail("param1,param2,param3,param4,param5,param6"))
             Log.Message("Mail was sent");
         else
             Log.Warning("Mail was not sent");
      }
   }
}

 

Thanks in advance!

  • Hi,

     

    Unfortunately, TestComplete does not provide an event like OnStopTestRun so far...

    So either use your solution or just add one more Test Item as the last one in the execution tree.

     

1 Reply

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Unfortunately, TestComplete does not provide an event like OnStopTestRun so far...

    So either use your solution or just add one more Test Item as the last one in the execution tree.