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.
Handling popup windows (revisited!)
All,
Our app has various links which produce a popup window. Typically (as is the case here) the popup window title is the same as the parent window). I have tried a simple test, that clicks "upload" in the parent window to produce the popup, then click "Cancel" in the popup to close it, and return to the parent.
The recorded script looks like:
_click(_link("Upload"));
_popup("AntiSpamPopup")._click(_link("Cancel"));
When I play this script, upload is clicked, the popup appears. However, Cancel fails. In the controller window I get:
>>>> step=_sahi._popup("AntiSpamPopup")._sahi._click(_sahi._link("Cancel"));
Window/Domain not found: popupNameFromStep=AntiSpamPopup; derivedName=; windowName=_e_dUnj; windowTitle=Anti-Spam; wasOpened=0; domain=
Where does "_e_dUnj" come from? Why does this fail?
Reading other threads on this forum, I tried editing "AntiSpamPopup" to be "Anti-Spam" (the window title). This eliminated the above error - but instead, plain old nothing happened!
**EDIT** Since first posting this, I tried:
_popup(/.*/)._click(_link(2));
This clicked the 2nd link on the main page - leaving the pop up window open??
BTW this is all in Firefox 3.5.13
Thanks in advance again!
Steve
Our app has various links which produce a popup window. Typically (as is the case here) the popup window title is the same as the parent window). I have tried a simple test, that clicks "upload" in the parent window to produce the popup, then click "Cancel" in the popup to close it, and return to the parent.
The recorded script looks like:
_click(_link("Upload"));
_popup("AntiSpamPopup")._click(_link("Cancel"));
When I play this script, upload is clicked, the popup appears. However, Cancel fails. In the controller window I get:
>>>> step=_sahi._popup("AntiSpamPopup")._sahi._click(_sahi._link("Cancel"));
Window/Domain not found: popupNameFromStep=AntiSpamPopup; derivedName=; windowName=_e_dUnj; windowTitle=Anti-Spam; wasOpened=0; domain=
Where does "_e_dUnj" come from? Why does this fail?
Reading other threads on this forum, I tried editing "AntiSpamPopup" to be "Anti-Spam" (the window title). This eliminated the above error - but instead, plain old nothing happened!
**EDIT** Since first posting this, I tried:
_popup(/.*/)._click(_link(2));
This clicked the 2nd link on the main page - leaving the pop up window open??
BTW this is all in Firefox 3.5.13
Thanks in advance again!
Steve
Comments
I had similar problem while I was developing a testing script for a page in my current project. Yes it was causing me great frustration, why can't I access any element in popup window. But spending some time on it, it paid off.
Please check following code if that would help you:
//==================================================================================
_click( _link("Select Category") ); // click on link in main window
_wait(2500);
_popup("SelectCategory")._click(_image("s.gif[3]")); //Click a tree node and let it to expand in popup window (popup window id is "SelectCategory") and tree node image can be accessed by s.gif[3]
_wait(1200);
_popup("SelectCategory")._click(_div("Other")); //Click tree node with text "Other" and wait for Ajax result from server
_wait(4000);
_popup("SelectCategory")._click(_button("Done")); //Click "Done" button on popup making it to close
_wait(400);
//==================================================================================
Change the time in _wait() for letting the dom objects fully load before to act upon them, as per your application.
And last of all very important, say thanks to me if that works out for you !
I assume you mean in my case something like:
_click(_link("Upload"));
_wait(2500);
_popup("Anti-Spam")._click(_link("Cancel"));
If so, no joy.... Or was there something else in your code I should have been paying attention to?
I did this in Chrome but I guess Firefox has some problems which I am also still facing.
Before my previous post I did not check it on Firefox but at that time it was working perfectly in Chrome.
In firefox using same code I am even unable to open up the popup. The dom gives some unknown error.
I am working on it and if I find any solution, I will post it here.
Thanks
I have the same problem with Firefox.
Have you found an answer?