sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #56303
[Bug 1909091] Re: Command line execution return code on script abort
should be a question first
** Changed in: sikuli
Status: New => Invalid
** Converted to question:
https://answers.launchpad.net/sikuli/+question/694632
--
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1909091
Title:
Command line execution return code on script abort
Status in Sikuli:
Invalid
Bug description:
Version: SikuliX 2.0.4 on Windows 10, Running Java 1.8.0_191
Setup:
I use Sikulix for GUI-testing.
I have a batch-script which calls different scripts in a loop. Every script is started in a clean enviroment and should be independent from the exit status of previous executions. The whole thing should run unattended and write a log file where it says which scripts have done a complete run.
Part of my Batch script: (%%d is the current script in the loop)
call java -jar Sikulix.jar -f logs/sikulix/%%d_%date%.log -r Tests/%%d
REM ERRORLEVEL 42 = Success because abort due to an error also returns Errorlevel 0
IF ERRORLEVEL 42 (
echo [%DATE% %TIME%]: %%d passed. >> logs/%DATE%_success.log
echo %%d passed
) ELSE (
echo [%DATE% %TIME%]: %%d failed with return code %errorlevel% >> logs/%DATE%_failed.log
echo %%d failed.
)
Problem:
When a SikuliX script gets aborted (FindFailed for example) the return code is always 0. That is not what i would expect. I expect a return code 0 only when everything went well. Therefore i need this ugly workaround that every script has an exit(42) at the end because that is the only case where everything went well.
try:/excerpt block is not practical for me because i want a different return code whenever anything unforeseen happens.
Is this a feature by design or a bug?
And if it is a bug it would be nice to have it fixed.
To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1909091/+subscriptions
References