I noticed this a while ago, when using Sessioncreator through the CLI the documentation says this:
@echo off
“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
But when warnings are in the logs I only get ERRORLEVEL 1 (Success).
This has been an issue for at least the past 3 years.
Overal not a big issue, I was just wondering if it’s just me.
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
:Timeout
GOTO End
:CannotRun
GOTO End
:Errors
GOTO End
:Warnings
GOTO End
:Success
GOTO End
:End
echo %ERRORLEVEL%
pause
In the TestErrorLevel project there is this test:
function test1()
{
Log.Warning(“This is a warning”);
}
I don’t seem to always get notifications from a reply, I’ve responded to. Hence the delay in replying.
I’ve run the same test using SessionCreator, and I am not getting the same results, with or without /UseActiveSession. Though Exit Codes are supported via SessionCreator, it’s not working as expected. So It’s best to open a Support Ticket via https://support.smartbear.com/testcomplete/message/ .
I had to get to a meeting… Here is the rest of what I found…
Each of these error levels should be returned to the CLI. In older versions, SessionCreator returned fewer ERRORLEVELS. So, I am not sure what is going on here.
[Edit] Check your version? [/Edit]
Applies to TestExecute 15.40, last modified on March 25, 2022