Forum Discussion

shantlk's avatar
shantlk
Contributor
6 years ago
Solved

How to close (kill) the TestExecute process using commandline

Hi, I need to launch TestExecute / TestComplete through commandline, run a project and then close TestExecute/ TestComplete after the run. I'm able to launch and run the project, but I cannot close...
  • NisHera's avatar
    NisHera
    6 years ago

    did you start command line as ...?

    start "My Title" /wait TestComplete.exe "C:\Work\My Projects\MySuite.pjs" /run /exit /SilentMode    

    ...will auto exist after compleating. (note start and exit command....)

     

    if you need to forcefully search and kill TC instances can use 

    tasklist /FI "IMAGENAME eq TestComplete.exe" 2>NUL | find /I /N "TestComplete.exe">NUL
    if "%ERRORLEVEL%"=="0" taskkill /F /IM "TestComplete.exe" /T
  • tristaanogre's avatar
    tristaanogre
    6 years ago

    As NisHera suggested, running TestComplete/TestExecute from the commandline, if you include the /exit or /e switch, once the test run is completed, this will close the tool.  This is the recommended way of doing so.