18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
How to get return code from _execute()
Hello,
is it possible to get the return code of the process run by _execute()?
I need to stop the test execution if the process fails.
Thank you in advance.
Tatiana
is it possible to get the return code of the process run by _execute()?
I need to stop the test execution if the process fails.
Thank you in advance.
Tatiana
Comments
you could save your return in a file and use the _readFile() API.
Regards
Wormi
_execute() will not return anything. But if you want to get the return code then you can redirect what ever you are executing to a file and then read this file.
If you are using an Sahiscript wich executes/includes other scripts, you can use http://sahi.co.in/w/exception-handling and let em fail.
When using a suite file, implement a a global variable with set and http://sahi.co.in/w/_getglobal
Use http://sahi.co.in/w/sahi-call-back-functions with a function which sets the global key false when a script fails.
An if cluase at the beginning of every script can determine, if there where any errors before and just skip execution.
Also, have a look at below URLs:
http://sahi.co.in/forums/viewtopic.php?id=381
Let me know if you face any issue.
Regards
Sumitra
I was looking for some easier way, but I'll try to follow your advice persisting the result and reading it afterwise.
Tatiana