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.
_wait Problems
Hi!
I got some problems with _wait. I try something like this:
_wait($time, _isVisible($element) == true );
It fires BEFORE element becomes visible. So, I try this instead:
function waitForVisible($element, $time){
for ($i=0;$i<$time;$i+=100){
_wait(100);
if (_isVisible($element)){
return true;
}
}
throw "Element is non visible!";
}
My question is: How I can force throw error so SAHI can process it correct? Or what I do wrong with _wait?
Thank you.
I got some problems with _wait. I try something like this:
_wait($time, _isVisible($element) == true );
It fires BEFORE element becomes visible. So, I try this instead:
function waitForVisible($element, $time){
for ($i=0;$i<$time;$i+=100){
_wait(100);
if (_isVisible($element)){
return true;
}
}
throw "Element is non visible!";
}
My question is: How I can force throw error so SAHI can process it correct? Or what I do wrong with _wait?
Thank you.
Comments
// Will wait till visible element
// or one second, whichever occurs sooner
can someone get this work under Chrome?
_wait(5000);
_alert('asda');
to test this script:
And it does not work anywhere! I mean I saw stage2 at once, not after 15sec.