Forum Discussion

itvrdeich's avatar
itvrdeich
Contributor
13 years ago

Closing down Tested Application

My tests involve 2 applications that require lots of application restarts and so on.



When running the tests using Test Complete I shut down the applications via our own application Exit button and it closes properly and the process ends.



When I run the same tests on another machine using Test Execute, it seems that sometimes (30% of the time) it doesnt end the process which means i cant restart the tested application.  The applications shuts down but the process is still running. 

I have a feeling SmartBear is using hooks in tcuihook.dll and the unload method in that library is not working correctly.  



I have also tried other ways of closing the application using the TestedApps object in test complete.



I tried termination the process if its still alive, but by doing this windows will throw an exception that the tcuihook.dll was the faulting module.



Any ideas please?

Thanks.

8 Replies

  • It might not be the cleanest/best approach, but I execute a PowerShell script to terminate my application at the end of any tests that don't shut it down correctly...  Just one line of script:



    Stop-Process -processname <yourProcessName>       <---   insert your process name without the '<' or '>'
  • function WaitThenKillClient()



    {



       var secondsToWait = 0;



       var process = "wsClient";



       var p = Sys["WaitProcess"](process, 1000, 1);



         while(p["Exists"])



         {



          if (secondsToWait >= 20000)



          {



            Log["Warning"]("She is ugly. Kill Her.");



            p["Terminate"]();



            Log["Warning"]("TestComplete was forced to end the wsClient process."); 



          } else {



            Log["Message"]("Running."); 



            Delay(500);



            secondsToWait+=1000;



          }



        }



    }



    Thats what i do.

  • That didnt come out nicely. You may want to paste it in a text editor :)
  • Our application has a exit button which is what i use to close the application down and restart it.

    However sometimes once it closes down the process remains running and it consumes 100% cpu nearly. Testing doesnt proceed untill i close the process down manually in task manager. Does anyone have any idea whats happening to it?



  • Hi Ivan,


    To help us reproduce the problem, please send us the project you are using and the application under test via the Contact Support form.

  • Its not as simple as that because our tests wont just run by installing a simple application. There is a huge setup involved. 

    Any other ways? Remote sessions etc?
  • Hi Ivan,


    When sending the support request via the Contact Support form, please specify the setup steps to let us reproduce the behavior on our side. If these steps can be implemented only on your side, ask the support team to help you by organizing a remote session with your desktop.