Forum Discussion
Here's an example, where I run individual functions i.e. test1, test2, test3, test4 to log either a message, warning or error.
When test1 completes, it returns ERRORLEVEL = 0.
When test2 completes, it returns ERRORLEVEL = 1.
When test3 completes, it returns ERRORLEVEL = 2.
When test4 completes, it returns ERRORLEVEL = 2, because the highest level is logged
If the instance of TestComplete/TestExecute is not executed within the same process, you will get a different retuned value.
- MW_Didata2 months agoSuper Contributor
EDIT: I tried the same using TestExecute instead of SessionCreator, TE does return the Errorlevel 1 warnings. SessionCreator does not.
For me I only get back ERRORLEVEL 0 on warnings, I did use SessionCreator not Testexecute.
"C:\Program Files (x86)\SmartBear\TestExecute 15\x64\Bin\SessionCreator.exe" RunTest /Username: /Password: /ProjectPath:"PathTo\TestErrorLevel.pjs" /UA /ScreenResolution:1600*900 /Timeout:9000 /project:TestErrorLevel
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%
pauseIn the TestErrorLevel project there is this test:
function test1()
{
Log.Warning("This is a warning");
}The test was run through the Execution plan
- rraghvani2 months ago
Champion Level 3
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/ .
Running test2() and test4()- MW_Didata2 months agoSuper Contributor
Thanks for verifying, I'll contact support with this issue!