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.
Recover from Loading a Blank page
Hi
We have a script which in short runs through all pages within a Sitemap. All is working great until we hit a page with a server error on it. This renders a Blank Page, When Viewing the Html There is no Source Code on the error page.
What we need to be able to do is to log this as an error but then go back to the Sitemap and carry on with the other links on the site.
There are around 1000 pages to test and this would be great if we can find a workaround to Log and Handle these Blank Pages.
The Script we are working on is;
_click(_link("Sitemap"));
var $index = 1;
var $LinkExists = _exists(_link($index, _in(_div("sitemap"))));
while ($LinkExists == true)
{
var $LinkName = _getText(_link($index, _in(_div("sitemap")))).replace("\u00fa","u").replace("& ","").replace("'","").toUpperCase();
var $NotCarHire = _getText(_link($index, _in(_div("sitemap")))).indexOf("Car Hire") == -1;
if ($NotCarHire == true)
{
// When the Page is Blank the Test Stops (As if waiting for the Page to Load).
_click(_link($index, _in(_div("sitemap"))));
var $errorslist1 = _getText(document.body).indexOf("The page cannot be found");
var $errorslist2 = _getText(document.body).indexOf("A systems administrator has been notified.");
var $errorslist3 = _getText(document.body).indexOf("Either the remote server is down or not reachable");
var $worked = ($errorslist1 == -1 && $errorslist2 == -1 && $errorslist3 == -1);
if($worked == true)
{
var $breadcrumb = _getText(_div("breadcrumbs")).replace("%C3%BA","u").replace("\u00fa","u").replace("& ","").replace("'","").toUpperCase();
_log($LinkName + " is fine", "success");
_log($breadcrumb);
var $correctBreadcrumb = $breadcrumb.indexOf($LinkName) > -1;
if ($correctBreadcrumb == true)
{
_assertTrue($correctBreadcrumb);
}
else
{
_log($LinkName + " | " + $breadcrumb + " DO NOT MATCH", "custom4");
}
}
else
{
_log($LinkName + " is broken", "failure");
}
_call(history.back());
}
$index++;
}
Thanks in Advance
Hayley
We have a script which in short runs through all pages within a Sitemap. All is working great until we hit a page with a server error on it. This renders a Blank Page, When Viewing the Html There is no Source Code on the error page.
What we need to be able to do is to log this as an error but then go back to the Sitemap and carry on with the other links on the site.
There are around 1000 pages to test and this would be great if we can find a workaround to Log and Handle these Blank Pages.
The Script we are working on is;
_click(_link("Sitemap"));
var $index = 1;
var $LinkExists = _exists(_link($index, _in(_div("sitemap"))));
while ($LinkExists == true)
{
var $LinkName = _getText(_link($index, _in(_div("sitemap")))).replace("\u00fa","u").replace("& ","").replace("'","").toUpperCase();
var $NotCarHire = _getText(_link($index, _in(_div("sitemap")))).indexOf("Car Hire") == -1;
if ($NotCarHire == true)
{
// When the Page is Blank the Test Stops (As if waiting for the Page to Load).
_click(_link($index, _in(_div("sitemap"))));
var $errorslist1 = _getText(document.body).indexOf("The page cannot be found");
var $errorslist2 = _getText(document.body).indexOf("A systems administrator has been notified.");
var $errorslist3 = _getText(document.body).indexOf("Either the remote server is down or not reachable");
var $worked = ($errorslist1 == -1 && $errorslist2 == -1 && $errorslist3 == -1);
if($worked == true)
{
var $breadcrumb = _getText(_div("breadcrumbs")).replace("%C3%BA","u").replace("\u00fa","u").replace("& ","").replace("'","").toUpperCase();
_log($LinkName + " is fine", "success");
_log($breadcrumb);
var $correctBreadcrumb = $breadcrumb.indexOf($LinkName) > -1;
if ($correctBreadcrumb == true)
{
_assertTrue($correctBreadcrumb);
}
else
{
_log($LinkName + " | " + $breadcrumb + " DO NOT MATCH", "custom4");
}
}
else
{
_log($LinkName + " is broken", "failure");
}
_call(history.back());
}
$index++;
}
Thanks in Advance
Hayley