Forum Discussion

mnsam's avatar
mnsam
Contributor
9 years ago

TestExecute/TestComplete freezes after closing the application

Using TC 10.30, windows 7 32 bit system, vc++ desktop aplication.

There is a flow of test, where we need to test 'closing of the application' and 'reopen it'. However, after closing the application using the close function, TC freezes and doesn't return.

What I have observed from the Task manager--Process is that, application.exe is still running in the background in that flow. But doesn't the TC execute a subroutine 'close'? if so, why should it freez ?

1 Reply

  • For the forcefull termination of application you can use the below.. the input for "Application" is process name. This will only terminate if the process still exists

     

    //*************************************************************************
    //This function is used to terminate the application if it exists before starting of the job
    
    function TerminateApplicationProcess(Application)
    {
    Sys["Refresh"]();
      if (Sys["WaitProcess"](Application,100)["Exists"])
        {        
              Sys["Process"](Application)["Terminate"]();
              //Log["Message"]("--->" + Application + " Process Existed Previously So terminating");
        }
    
    }