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.
Try-catch not working
I'm not able to continue execution after error at (_click(_link("does not exist")). its not Continuing execution of function 2.
but it goes to catch and log error.
I'm following below method
mainFunction() {
func1();
func2();
}
func1() {
try{
_click(_link("Aktivitet"));
_click(_link("does not exist"));
_click(_link("Aktivitet"));
}
catch(error) {
var $ErrMessage = $error.message;
_logException($ErrMessage);
}
}
func2() {
try{
_click(_link("Search"));
_click(_link("submit"));
}
catch(error) {
var $ErrMessage = $error.message;
_logException($ErrMessage);
}
}
but it goes to catch and log error.
I'm following below method
mainFunction() {
func1();
func2();
}
func1() {
try{
_click(_link("Aktivitet"));
_click(_link("does not exist"));
_click(_link("Aktivitet"));
}
catch(error) {
var $ErrMessage = $error.message;
_logException($ErrMessage);
}
}
func2() {
try{
_click(_link("Search"));
_click(_link("submit"));
}
catch(error) {
var $ErrMessage = $error.message;
_logException($ErrMessage);
}
}
Comments
Try with the following script,
This might help you.
Regards,
Theeran.