Forum Discussion

tinauser's avatar
tinauser
Frequent Contributor
14 years ago

run several TC commands from command line

Hallo,

I know how to run a project, or even a unit from command line. I also know how to delay two commands from the command line.

The question is, if I have more project to run, shall I always close and re-open the application?



example



start /wait "TestExecute"
"C:\Program Files\Automated QA\TestExecute8\Bin\TestExecute.exe" "C:\Work\My
Projects\MySuite.pjs" /r /p:MyProj /u:Unit1 /rt:F1 /exit /SilentMode



start /wait "TestExecute"
"C:\Program Files\Automated QA\TestExecute8\Bin\TestExecute.exe" "C:\Work\My
Projects\MySuite.pjs" /r /p:MyProj /u:Unit1 /rt:F1 /exit /SilentMode



This will work but:

1. It will open and close the application two times

2. It will load the log file two time



Is not possible to open the application only once and close only at the end?

Is not possible to prevent TestExecute to load the log at the end of the run?



Thanks
  • Hi,


    You can control TestExecute via COM. For example, you can create a .bat file that will launch TestExecute and run the projects in turn without closing TestExecute.


    For more information, please read Working With TestExecute via COM in the online documentation.

  • tinauser's avatar
    tinauser
    Frequent Contributor
    Hallo, thanks for the answer.

    I do not have much experience with COM services nor with DOS.

    Could you provide a short example of a .bat file connecting to TE via COM?



    thank you
  • Hi,


    You can create an ordinary .js or .vbscript file that will launch the projects in the needed way and run this file from the command line.


    The script will work with TestExecute via COM. In the script, you need to create a reference to the TestComplete object and then use the Integration object to perform typical actions over TestComplete, like running projects and tests. For more information about these objects and for a sample code that demonstrates how to use them, please see Working With TestExecute via COM in the online documentation.