cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the execution Status if Passed or Failed

SOLVED
Occasional Contributor

How to get the execution Status if Passed or Failed

Hi Guys,

 

Another Newbie question here:

 

I have a set of  7 automated test and the last part will send the execution result using sendmail, this works perfectly if All the 6 Testcases passed.  

 

If any of the 1-6 testcases failed,  my SendMail function is not executed, we dont have any email notification, any idea how to do that?  

 

ex. if 1st test failed,  should still should still execute SendMail..

 

Any comments are highly appreciated.

 

Thanks in advance

Tags (1)
2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Hero

Re: How to get the execution Status if Passed or Failed

Most likely you have "Stop On Error" set to true in Tools | Current Project Properties | Playback.  As soon as an error gets logged, this will cause your test project to halt immediately, preventing any future tests to execute in that run.

 

My recommendation is to turn off any and all options that automatically stop the project on an error and build your code/tests in such a way that they will halt the individual test on an error but not halt the whole project.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Super Contributor

Re: How to get the execution Status if Passed or Failed

Hi Louiselaine,

In addition to what @tristaanogre said, I suggest you to add to the event "OnLogError" the following script :

 

function GeneralEvents_OnLogError(Sender; LogParams);
begin
  Runner.Stop(True);
end;

 

See the help for the True paramete of Runner.Stop

It will pass to the next test item...

4 REPLIES 4
Community Hero

Re: How to get the execution Status if Passed or Failed

Most likely you have "Stop On Error" set to true in Tools | Current Project Properties | Playback.  As soon as an error gets logged, this will cause your test project to halt immediately, preventing any future tests to execute in that run.

 

My recommendation is to turn off any and all options that automatically stop the project on an error and build your code/tests in such a way that they will halt the individual test on an error but not halt the whole project.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Occasional Contributor

Re: How to get the execution Status if Passed or Failed

Hi @tristaanogre

 

Thanks for your suggestion.   It works.  

This is a good start for me to tweak some more when handling execution status Smiley Happy

 

Louiselaine!

Super Contributor

Re: How to get the execution Status if Passed or Failed

Hi Louiselaine,

In addition to what @tristaanogre said, I suggest you to add to the event "OnLogError" the following script :

 

function GeneralEvents_OnLogError(Sender; LogParams);
begin
  Runner.Stop(True);
end;

 

See the help for the True paramete of Runner.Stop

It will pass to the next test item...

Occasional Contributor

Re: How to get the execution Status if Passed or Failed

Hi @m_essaid

 

Thanks for your reply,  you suggestion is good! knowing that I am know to TestComplete.

Will take a look it this too.  

 

Regards

Louiselaine

New Here?
Join us and watch the welcome video:
Watch the New Interview
7Mistakes
Join the September Hub-bub to show off, learn and win