Forum Discussion

Haiyangwhu's avatar
Haiyangwhu
Contributor
11 years ago

Don't want to terminate tested application when test item timeout has expired

Hi,



When using test complete to run test items, the tested application will be terminated automatically if one test item is timeout. However i don't want the tested application to be closed.



I know we can do that in below ways:

1. Set Timeout = 0 for each test item, and handle when it should stop in test script. There will be too much to wait and check, it's a little complicated.

2. Launch tested application by DbgServices, it won't terminate tested application but quite a lot of Module/Thread logs will be logged and this is annoying.



I don't want to terminate tested application when test item timeout, i want to keep test script & test logs clean and simple. What should i do?



Thanks,

Ocean
  • murugans1011's avatar
    murugans1011
    Regular Contributor
    Hi, I too hav reproduced the problem. One of the the possiible solution is to launching the testedapp from wsh



      Sys.OleObject("WScript.Shell").Exec("C:\WINDOWS\system32\notepad.exe")





    try this and let me know ur results
  • murugans1011's avatar
    murugans1011
    Regular Contributor
    why dont u modify ur test script for not closing the tested app and the end of test
  • The tested application is terminated by TestComplete, not by my test script. I don't specify OnTimeout event for the project.
  • murugans1011's avatar
    murugans1011
    Regular Contributor
    i dnt understood how this happening, if the test item time is expired the tc posts error to the testlog stat tat  "The execution timeout has expired" and it will not terminate the test application until u do so. may be u can check for "onlogerror" event which is closing the tested app
  • The purpose of the Timeout function is to set the maximum execution time of a test item or project. You set it to one minute therefore it is terminated after 60 seconds. If you don't want the item to be terminated then don't set the timeout via the test item page. 



    I use my own timeout functions where you pass the object you want to wait for and the time you want to wait, if it isn't found in that time then it moves on without terminating anything. 





  • Thanks Steven for you reply.



    There are plenty jobs are queued for running,  i would expecte each of them can be finished within a specific time (e.g. 1~2 hours).

    I'm also using own functions to wait an object for a specific time, but not for the whole test item. Sometimes the test running can be very slow due to test VM performance issue or network issue, i don't want the execution time of a group grows wildly, so a timeout value for each test item would be helpful.



    When tested application is launched in debug mode, it won't be terminated when test item is timed out. I'm looking for a simple solution that tested application launched in simple mode won't be terminated when timed out. Is there any test complete configurations can achieve that?



    -Ocean
  • Thanks Murugan!

    it doesn't terminate the application when test item is timed out (already tested with the notepad example). Why didn't i think of it?



    I've changed the launch part in my tests, and i'm running them now to make sure this change won't affect settings in Project properties tab.



    -Ocean





  • murugans1011's avatar
    murugans1011
    Regular Contributor
    Glad it helped.



    u can also contact support team regrading this nd u can get better solution and original cause. wondering if its not  an issue y it doest terminate appln onusing dbgservices