Forum Discussion

jsc's avatar
jsc
Regular Contributor
13 years ago

recognize manual stop of test

Hi all,



is there any possibility to recognize if the test is stopped manually via the stop-button?



I am sending emails at the end of each test and when I stop the test manually there should no email be sent.



Kind regards,



Joachim

7 Replies

  • Hi Joachim,


    Unfortunately, there is no way to determine whether the test execution was stopped with the Stop button.


    As far as I understand, you create the OnStopTest event handler to send e-mails when the test is stopped. In this case, TestComplete sends an e-mail if the test is stopped manually as well.


    As a workaround, you should not to use the OnStopTest event. You should add a function that sends e-mails at the end of each test. In this case, e-mails will be sent when the test is over, and they will not be sent when you stop the test manually.

  • jsc's avatar
    jsc
    Regular Contributor
    Hi Margaret,



    your workaround has the drawback, that there will be no mail if the test stops somewhere in the middle of the test run. (without manual stopping)



    I do have an extra functions handling the sendMail-stuff, for example if the test run was completed, then there is an success-message, if the test stops somewhere else, ther is an message "test stopped" - and it is important for me to know if my test stopps somewhere unintended.



    So the your workaround would cancel the last message as well.






  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    If you're in a place to be able to run the tests and manually interfere with them, stopping them manually, you could just throw a break-point into your code for sending the e-mail and bypass it.
  • jsc's avatar
    jsc
    Regular Contributor
    The tests are running with TestExecute 8, so I cannot access the scripts, just manually stop the test with the button.
  • jsc's avatar
    jsc
    Regular Contributor
    I got an OnLogError handler doing different things (sorting bugs as known or new, counting them, etc.).

    The mail is send at the end of the test, regardless if the test finishes successfull or is aborted in the middle... in every case at the end there is the a sendmail() function called.



    This is all ok so far, I just want the manual stopping be recognized, so that in this case no mail will be sent.
  • Hi Joachim,


    Could you please send us the test project or the script code you are using? This will help us find a solution to your problem faster.


    Thanks in advance.