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.
_logExceptionAsFailure()
OK, I know that I've asked about this before, but I'm still having a problem with Sahi stopping script execution thought using _logExceptionAsFailure(). I've tried different ways to execute this, just using a try/catch block and creating an onScriptFailure function, but the script is still persisting. If someone could tell me what I need to do to get the script to STOP execution.
So, say assertion fails, and I want to kick off _logExceptionAsFailure() and end the script without going further:
try {
// if Aaanew Aaaemployee exists, I want to exit
_assertNotExists(_listItem("Aaanew Aaaemployee"));
} catch(e) {
_logExceptionAsFailure(e);
}
When I run this, I get an error message correctly when the listItem exists, however, the following statements get executed (ie the script is continuing to run) when I'd prefer that the script exit.
Please let me know what I need to do to have a proper script exit.
Thanks,
Glenn
So, say assertion fails, and I want to kick off _logExceptionAsFailure() and end the script without going further:
try {
// if Aaanew Aaaemployee exists, I want to exit
_assertNotExists(_listItem("Aaanew Aaaemployee"));
} catch(e) {
_logExceptionAsFailure(e);
}
When I run this, I get an error message correctly when the listItem exists, however, the following statements get executed (ie the script is continuing to run) when I'd prefer that the script exit.
Please let me know what I need to do to have a proper script exit.
Thanks,
Glenn