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.
Exception Handling
Hi Team,
Can anybody tell me how to handle exceptions on SAHI. I want to avoid various exceptions coming up in SAHI and divert them into my scripts so that I can look at them at the spot and make necessary corections.
Regards,
Ashvin.
Can anybody tell me how to handle exceptions on SAHI. I want to avoid various exceptions coming up in SAHI and divert them into my scripts so that I can look at them at the spot and make necessary corections.
Regards,
Ashvin.
Comments
Have a look at this:
http://sahi.co.in/w/exception-handling
(I just added it)
Regards,
Narayan
Thanks for the post
Regards,
Ashvin.
I want to show the exception occured in my alert box. Can you tell me how can I do that.
Regards,
Ashvin.
when i tried this code it got executed till the corrective action, but i got the error for the last line i.e
_logException(e) and playback failed message came.I got the error like this
"JSERROR Cannot convert NaN to Javalang integer"
try
{
_click(_link("does not exist"));
}
catch(e)
{
$message = "this button does not exist";
_alert($message);
_click(_link("Log Off")); // Corrective action
_logException(e); // Logs the exception, but does not fails,
}
How to resolve this?
Donna
I have one more doubt also.
When I m using " _log()",where should i lookfor the log file .
Means inside sahi folder where the logfile is getting generated?
Did anybody get some solution regardig this?
_log() generates the log line inside your html log file that you view by clicking "View Logs" link on the sahi controller.
You can also find the log in /sahi/logs folder.
Regards,
Pankaj.
https://sourceforge.net/project/showfiles.php?group_id=151639&package_id=309861&release_id=667852
This build is a nightly build, but you can use it. All changes will be incorporated in the new stable build, which should come soon enough.
Regards,
Narayan
Can I redirect exceptions which Im getting on the command prompt runing SAHI.bat on to alertbox. Presently, I can use only custom messages.
Regards,
Ashvin.