Forum Discussion

sameerjade's avatar
sameerjade
Frequent Contributor
5 years ago
Solved

How to get TestExecute exit codes

Hi,

I am running my TestComplete tests via TestExecute using a batch file (on TeamCity). I want to be able to get information if a test failed. For this I am trying to get the exit codes shown here:

https://support.smartbear.com/testexecute/docs/running/automating/command-line/exit-codes.html

I am not sure how to get these exit codes. I tried running the batch file via a command prompt, but did not see any exit codes. I checked in the cmd window, exported log file. 

My command line:

"C:\Program Files (x86)\SmartBear\TestExecute 12\Bin\TestExecute.exe" C:\svn\TestComplete\myProject\myProject.mds /run /project:Reg360 /test:"Smoke Tests|SmokeTest_04" /SilentMode /ExportLog:C:\Reg360_smoke_tests\Export_Logs\SmokeTest_04\SmokeTest_04_log.html /exit /Timeout:180

Thank you!

Regards,

Sameer

  • Hi sameerjade,

     

    In the article you specified I see an example that works with the ERRORLEVEL variable. It looks like it contains the exit code

    C:\TestExecuteFolder\Bin\TestExecute.exe C:\Projects\MyProj\MyProj.mds /run /exit
    
    IF ERRORLEVEL 1001 GOTO NotEnoughDiskSpace
    IF ERRORLEVEL 1000 GOTO AnotherInstance

2 Replies

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi sameerjade,

     

    In the article you specified I see an example that works with the ERRORLEVEL variable. It looks like it contains the exit code

    C:\TestExecuteFolder\Bin\TestExecute.exe C:\Projects\MyProj\MyProj.mds /run /exit
    
    IF ERRORLEVEL 1001 GOTO NotEnoughDiskSpace
    IF ERRORLEVEL 1000 GOTO AnotherInstance