Forum Discussion

dpiotrowski's avatar
dpiotrowski
Contributor
12 years ago

Test execution is stuck on "The window was destroyed during method execution."

Hello,



I've been trying to automate a test case, in which the application under test may get hung - if it gets hung I'd like to killl the process and restart the application to proceed with further tests. The only problem is that I'm not able to tell if its hung or not (in order to decide whether the process should be killed).



First I thought that after performing the operations which may cause the application to hang, I'd try to close some opened modal window and check if I can perform some new actions on the application - If they succeed it means everything is fine, if not it indicates that the application is hang. The problem is that, when appliation is hang, trying to close this window causes TestComplete to stuck at the line calling the Close() function, stopping TestComplete manually doesn't help (it's in the "Stopping" state all the time), I have to kill the application under test process manually to be able to stop the tests. In the log I receive this message "The window was destroyed during method execution." (it corresponds to the line where I tried to close a modal window). What I'd like to accomplish is to be able to decide in the tests whether the application is hung and I should kill the process or it's fine and I can proceed with further tests.



Can you advice me a proper way to overcome this problem? Is there maybe a way to set  a timeout, after which TestComplete will proceed to further steps if the window, on which it is trying to perfrom some actions, was destroyed.