18 January 2026:


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.

Browser error messages

lonely_girl01lonely_girl01 Members
edited November -1 in Sahi - Open Source
Hi,

Can Sahi detect the browser error messages (i.e. The page isn't redirecting properly (FF), This webpage has a redirect loop (Chrome) )??

I have a script where sahi will just redirect to the links specified in an excel file using _navigateTo() function.
Then, after the redirect and the browser error message appears, sahi fails, therefore, stopping the script even if there are still links left for redirection.

I tried using the try-catch method where the catch block will force navigate to a specific site and then, will continue reading the links. But, it still fails.

Here is the snippet:
var $db = _getExcel("C:/excel_path.xls", "Sheet1");
var $dbData= $db.getData();

for (var $ctr=1; $ctr<=$dbData.length-1;$ctr++) {                            
     try {
          _navigateTo($dbData[$ctr][1]);
     } catch(e) {
          _logException(e);
          _navigateTo("google.com", true);
          continue;
     }                            
}


Thanks for any reply.
Sign In or Register to comment.