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.
Identifying popup title/popup exists or not
Hi,
I need to verify whether a poup is displayed and which popup is getting loaded when a click is performed. I tried many ways , When I assert using sahi controller, it identifies the popup and returns correct title. But when runs the script, it could not identify popup title, it shows parent window titile.
Is there a way to make sahi to identify popup title when suite/script runs?
Thanks.
_click($sId);
var $popupTtile;
_set($popupTtile,window.document.title );
var $advPExists = false;
if($popupTtile == "X"){
_popup("X")._assertExists(_span("XXXTabNavButton1"));
_popup("X")._assertExists(_div("XXXControls"));
//steps for x window
_popup("X")._closeWindow();
$advPExists = true;
}else if($popupTtile == "Y"){
_popup("Y")._assertExists(_span("XXXTabNavButton1"));
_popup("Y")._assertExists(_div("XXXControls"));
//steps for y window
_popup("Y")._closeWindow();
$advPExists = true;
}
Env: Windows XP . browser IE8. Sahi Build: 2011-05-25.
I need to verify whether a poup is displayed and which popup is getting loaded when a click is performed. I tried many ways , When I assert using sahi controller, it identifies the popup and returns correct title. But when runs the script, it could not identify popup title, it shows parent window titile.
Is there a way to make sahi to identify popup title when suite/script runs?
Thanks.
_click($sId);
var $popupTtile;
_set($popupTtile,window.document.title );
var $advPExists = false;
if($popupTtile == "X"){
_popup("X")._assertExists(_span("XXXTabNavButton1"));
_popup("X")._assertExists(_div("XXXControls"));
//steps for x window
_popup("X")._closeWindow();
$advPExists = true;
}else if($popupTtile == "Y"){
_popup("Y")._assertExists(_span("XXXTabNavButton1"));
_popup("Y")._assertExists(_div("XXXControls"));
//steps for y window
_popup("Y")._closeWindow();
$advPExists = true;
}
Env: Windows XP . browser IE8. Sahi Build: 2011-05-25.
Comments
I tried with this code and nothing seem to happen.
Any help is greatly appriciated.
var $popupWindow = "something";
var $condn ="";
_popup($popupWindow)._set($condn, _exists(_cell("Details")));
if($condn)
{
_debug("Window Exists");
}
Use this:
Check if this solves your issue.
Regards
Sumitra
when I ran the following Code it does not do anything. Doesnt even give "Sucess" or "failure" message.
var $popupWindow = "Processing";
if(_condition(_exists(_popup($popupWindow)._cell("Details"))))
{
_debug("Window exists");
}else
{
_debug("No exists");
}
Kindly Ctrl+Hover on _cell("Details") on the popup window and check what the controller is identified the popup as?
Use the prefix of the popup which is identified by the controller.
The below code works for me with http://sahi.co.in/demo/ as the start URL.
Regards
Sumitra
For me, when the window is not present with the name specified in _popup(), it fails.
Most of the time it works if the window is present.