Ask a Question

onStop event runs after every keyword

Senior Member

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");
             Log.Warning("Mail was not sent");


Thanks in advance!

Champion Level 3



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.


  /Alex [Community Champion]
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
Showing results for 
Search instead for 
Did you mean: