Ask a Question

onStop event runs after every keyword

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

 

Thanks in advance!

1 REPLY 1
AlexKaras
Community Hero

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.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] 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 Heroes]
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 Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
cancel
Showing results for 
Search instead for 
Did you mean: