Forum Discussion

KSQian's avatar
KSQian
Contributor
7 years ago
Solved

TestComplete/TestExecute command line

Hi,

 

I'm trying to execute my projects via the command line and it's working except TC has to be not running.

 

If I try to run it with TC or TE open, it'll say its already open and won't proceed to run the project.

 

Is there any flag to override that and just run the project on the opened instance? 

 

All of our commands have /exit, which should make sure it clears up the process for the next run. But sometimes there's always that one meddling kid (me) who manually opens up TC/TE then forgets the close the process on the test machine, and ruins all the subsequent command line triggers. 

 

Help me protect myself from me.

 

Thanks!

3 Replies

  • baxatob's avatar
    baxatob
    Community Hero

    Hi,

     

    You can't "override" already running TC instance. But you can use some workaround:

     

    if Sys.Process("TestComplete").Exists:
        Sys.Process("TestComplete").Terminate()

     

    So TC/TE will kill itself.

     

    :-) 

    • KSQian's avatar
      KSQian
      Contributor

      In order to run that line of code, the project has to run in the first place ;) 

       

      But yeah - there can be some kind of side process that just polls the TestComplete.exe and kill it as necessary.