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.
_popup and while loop
Need syntax help for while loop with _popup:
I tried the following but none works.
Please help.
Env: Windows, IE 6 ; Sahi_20101103
while(_popup($popupWindow)._assertNotExists(_cell("/Results are:/"))) {
_wait(1000);
doSomethingElse ();
}
while(_condition(_popup($popupWindow)._assertNotExists(_cell("/Results are:/")))) {
_wait(1000);
doSomethingElse ();
}
while(!_popup($popupWindow)._assertExists(_cell("/Results are:/"))) {
_wait(1000);
doSomethingElse ();
}
while(!_exists(_popup($popupWindow)._cell("/Results are:/"))) {
_wait(1000);
doSomethingElse ();
}
I tried the following but none works.
Please help.
Env: Windows, IE 6 ; Sahi_20101103
while(_popup($popupWindow)._assertNotExists(_cell("/Results are:/"))) {
_wait(1000);
doSomethingElse ();
}
while(_condition(_popup($popupWindow)._assertNotExists(_cell("/Results are:/")))) {
_wait(1000);
doSomethingElse ();
}
while(!_popup($popupWindow)._assertExists(_cell("/Results are:/"))) {
_wait(1000);
doSomethingElse ();
}
while(!_exists(_popup($popupWindow)._cell("/Results are:/"))) {
_wait(1000);
doSomethingElse ();
}
Comments
Regards,
Narayan
Let me explain why:
With hard-coded popup Window Title is used- both of these operation work.
But once popup window is reference with /.* -xxxxx- .*/ - the same operations no longer work: getting [Exception][object Object]
//when _exists works with _popup
_popup("Test Page - This is only a Test - user1 (Sample/User/Text)")._exists(_div("This user has already been taken"));
//when it does not work with a reference popup
var $popupWindow = "/.*This is only a Test.*/" ;
_popup($popupWindow)._exists(_div("This user has already been taken"));
//when it does not work with a reference popup
var $popupWindow = "/.*This is only a Test.*/" ;
var $condn = false;
_popup($popupWindow)._set($condn, _exists(_div("This user has already been taken")));
_debug($condn) ;
//when _getText works with _popup
_popup("Test Page - This is only a Test - user1 (Sample/User/Text)")._getText(_div("This user has already been taken"));
//when it does not work with a reference popup
_popup($popupWindow)._getText(_div("This user has already been taken"));
//when it does not work with a reference popup
var $popupWindow = "/.*This is only a Test.*/" ;
var $ReadText ;
_popup($popupWindow)._set($ReadText, _getText(_div("This user has already been taken")));
_debug($ReadText) ;