TestComplete.exe provides the following exit codes, which report on the results of the last test:
Exit Code | Description | ||
---|---|---|---|
0 | The last test did not produce errors or warnings. | ||
1 | The last test results include warnings but no errors. | ||
2 | The last test results include errors. | ||
3 | The test cannot be run because of an error. Some typical errors are:
The test engine also returns the code 3, if you run a project or project suite and the test was stopped with a call to the Runner.Stop method within the |
||
4 | The test run was stopped by the timeout specified with the /Timeout command-line argument. For more information, see the Terminating Tests on Timeout topic. |
||
127 | Unable to launch TestComplete, because some TestComplete files are missing or the installation is damaged. | ||
1000 | Unable to launch TestComplete, because another instance of TestComplete is already running. | ||
1001 | Unable to start TestComplete, because there is not enough free disk space. | ||
-1 | Unable to launch TestComplete because the license check has failed and TestComplete cannot obtain a license. You can find information on TestComplete licensing in Licensing TestComplete.
To resolve licensing problems, please use the Licensing Troubleshooter on our web site: |
Normally, these codes are of use when TestComplete is launched from a batch file:
Note: | The following example uses the 32-bit version of TestComplete. If you use 64-bit, the TestComplete executable is located in the <TestComplete>\x64\Bin folder. |
Batch File
REM Clears the screen
CLS
@ECHO OFF
REM Launches TestComplete,
REM executes the specified project
REM and closes TestComplete when the run is over
"C:\TestCompleteFolder\Bin\TestComplete.exe" "C:\TestCompleteProjects\MyProj\MyProj.mds" /run /exit
IF ERRORLEVEL 1001 GOTO NotEnoughDiskSpace
IF ERRORLEVEL 1000 GOTO AnotherInstance
IF ERRORLEVEL 127 GOTO DamagedInstall
IF ERRORLEVEL 4 GOTO Timeout
IF ERRORLEVEL 3 GOTO CannotRun
IF ERRORLEVEL 2 GOTO Errors
IF ERRORLEVEL 1 GOTO Warnings
IF ERRORLEVEL 0 GOTO Success
IF ERRORLEVEL -1 GOTO LicenseFailed
:NotEnoughDiskSpace
ECHO There is not enough free disk space to run TestComplete
GOTO End
:AnotherInstance
ECHO Another instance of TestComplete is already running
GOTO End
:DamagedInstall
ECHO TestComplete installation is damaged or some files are missing
GOTO End
:Timeout
ECHO Timeout elapses
GOTO End
:CannotRun
ECHO The script cannot be run
GOTO End
:Errors
ECHO There are errors
GOTO End
:Warnings
ECHO There are warnings
GOTO End
:Success
ECHO No errors
GOTO End
:LicenseFailed
ECHO License check failed
GOTO End
:End
When launching TestComplete from a command line or batch file, it is not recommended to use the RunAs command, since this will significantly slow down the test execution. |