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.
Random failures?
Since the 2009-10-22/23 releases I've been seeing some random failures in my tests. For example:
I had the following error in my Sahi log:
_wait(1000); at 27-Oct-2009 19:30:06
JSERROR
Step >_sahi._debug ("Exception in test");< did not complete in 130 seconds. at 27-Oct-2009 19:34:29
Which corresponds to the following code in my script:
_debug("DISABLE SPEAKERS");
setFunctionEnable(functionEnableMask,bitMap);
//Check if popup dialogue should be called
for (lc2 = 0; lc2 < 120; lc2++)
{
dialogueResult = checkAdhocmsgContent("head");
if (dialogueResult)
{
_debug ("FOUND!!");
getScreenDump($baseLogDir);
getRamContents($baseLogDir);
break;
}
_wait(1000);
}
Which is contained in the following try catch block
catch (e)
{
_debug ("Exception in test");
_logExceptionAsFailure(e);
getTopSnapshot($baseLogDir);
getScreenDump($baseLogDir);
getSyslog($baseLogDir, 10);
getRamContents($baseLogDir);
resetFunctionEnable();
}
I run a suite each night with about 8 tests repeated multiple times. If I look through the logs in the morning, I will get 5 - 6 instances of each test passing okay, then another 5 - 6 instances of each test failing due to the same error mentioned above. This exception isn't always thrown at the same point in each test (but the test always times out on the first line of the catch block), so I'm struggling to pin-point whether it's a problem at my end or not?
I've been watching a test when it's failed and the I can see the correct web page on the screen, so from my point of view it all looks okay, but for some reason the Sahi test seems to throw an exception, then timeout as above.
Has anyone seen similar errors since the 2009-10-22/23 release?
Cheers,
Les.
I had the following error in my Sahi log:
_wait(1000); at 27-Oct-2009 19:30:06
JSERROR
Step >_sahi._debug ("Exception in test");< did not complete in 130 seconds. at 27-Oct-2009 19:34:29
Which corresponds to the following code in my script:
_debug("DISABLE SPEAKERS");
setFunctionEnable(functionEnableMask,bitMap);
//Check if popup dialogue should be called
for (lc2 = 0; lc2 < 120; lc2++)
{
dialogueResult = checkAdhocmsgContent("head");
if (dialogueResult)
{
_debug ("FOUND!!");
getScreenDump($baseLogDir);
getRamContents($baseLogDir);
break;
}
_wait(1000);
}
Which is contained in the following try catch block
catch (e)
{
_debug ("Exception in test");
_logExceptionAsFailure(e);
getTopSnapshot($baseLogDir);
getScreenDump($baseLogDir);
getSyslog($baseLogDir, 10);
getRamContents($baseLogDir);
resetFunctionEnable();
}
I run a suite each night with about 8 tests repeated multiple times. If I look through the logs in the morning, I will get 5 - 6 instances of each test passing okay, then another 5 - 6 instances of each test failing due to the same error mentioned above. This exception isn't always thrown at the same point in each test (but the test always times out on the first line of the catch block), so I'm struggling to pin-point whether it's a problem at my end or not?
I've been watching a test when it's failed and the I can see the correct web page on the screen, so from my point of view it all looks okay, but for some reason the Sahi test seems to throw an exception, then timeout as above.
Has anyone seen similar errors since the 2009-10-22/23 release?
Cheers,
Les.
Comments
script.max_cycles_for_page_load=1200
in sahi.properties to something greater, say 3000 or something.
(You could add this property in userdata.properties too).
I think there has there was a gap of more than 120 seconds from the last executed step.
Check if this works, else let us know.
Regards,
Narayan
I tried increasing the max cycles to 3000, but I still see the problem, here's the debug from the terminal window:
Rhino lib:Step >_sahi._click(_sahi._byId("channel_down"));< did not complete in 310 seconds.
And what I see in the html log:
JSERROR
Step >_sahi._debug("Exception in test");< did not complete in 310 seconds. at 28-Oct-2009 12:06:29
I'm looking at the web page now, and I can see the "channel_down" button exists, plus I can see the ID is correct when viewing the page source. This problem occured on the 3rd iteration - both iterations of the same code prior to that were fine. Though the problem isn't specific to the 3rd iteration - it will randomly fail on any iteration during the nightly runs.
I have some logging in the catch block of the exception that will verify the state of the system, but unfortunately it's not being executed. Looking at the sahi html log the catch block is being hit, as the debug statement is the first line in the catch.
These tests worked okay in the release prior to 2009-10-22, and although I did on rare occasions see an exception, the code in the catch block was always executed okay.
The exceptions I saw on previous releases were generally this one:
Logging exception: _click(_image("dim_bar_60.png"));
Error: The parameter passed to _click was not found on the browser
Error("The parameter passed to _click was not found on the browser")@:0
http://172.18.80.11/_s_/spr/concat.js:348
http://172.18.80.11/_s_/spr/concat.js:386
http://172.18.80.11/_s_/spr/concat.js:2423
http://172.18.80.11/_s_/spr/concat.js:2423
http://172.18.80.11/_s_/spr/concat.js:2303
Which I could quantify as the dim_bar image is not always displayed.
But at the moment I'm lost as to why I'm getting the failures. Any ideas or suggestions would be appreciated
-- Edit:
Hi Narayan,
To save a wild goose chase, I think the main issue at the moment is the fact I'm just getting a JSERROR and the code in the exception block isn't being executed. Once we get past that I'll be able to tell exactly what was happening on the webapp at the time, and thus work out whether the root cause is at my end of not.
Looks like a bug to me. Investigating this. Do let me know if you notice any thing else related to this issue.
Regards,
Narayan
Cheers,
Les.
Just a quick update on this. I've looked through my older runs and analysed some of the failures I had. Although I'm seeing more failures now (which could be a red herring), there were some old failures that appeared to fail for no apparent reason (i.e. the web page contained the button I was trying to click)
The one thing these pages had in common were that they were all on pages with an iFrame. The main page is on local host and the iframe points to a remote server.
Is it possible that in some cases sahi's scope is switching from the main page to the iframe in some instances, which means a button that exists on the main page (and has been clicked before on the previous iteration) is now out of scope and Sahi can't see it?
I think that may help explain the random failures?
And could that also have something to do with why I just get a JSERROR and my exception catch block isn't being executed? (in the release prior to 2009-10-22/23 if I ever had a failure, the catch block was always executed)
Cheers,
Les.
I've been encountered the same problem in sahi 20100611:
"_click(_span("event_edit_link")) did not complete in 150 sec"
the error probability is quite rare, approx. 1 per 10 test runs. I adjusted max_cycles_for_page_load = 3000, and i am trying to repeat the error now..
but I could'nt yet.. of course I inform you about news on this error soon..
I am facing same Issue while Executing bunch of Test Scripts.
Error:-
"JSERROR
Step >_sahi._log("TC593");< did not complete in 150 seconds."
and then further execution of script is stopped.
And this is occurring on Random time and on random steps of execution. Is there any updates for this issue??
Thanx,
Akash.
i also posted the same issue before still it is not resolved after changing the page load to 2000 also.We are still facing this problem randomly scripts are failing with no reason .Can you guys please check on this issue.
Regards
Aparanji