Please note that Sahi's development and support teams do not actively monitor this. This is more a community forum. If you are a Sahi Pro user looking for commercial support, please email support @ with your query.

script halts when I open a popup

rakeshsilswalrakeshsilswal Members
edited 10:54PM in Sahi - Open Source

I am facing one issue with SAHI script playback with popuy


1) I am on a base screen and i am opening one popup window.
<----script stops here--->
2) I am clicking other links on popup window.

When i play this script it just stops after first step, although it opens a popup, but it doesn't do anything. But when I manually play the script again (from step 2), it perfectly runs? what am i missing...

on screen it just stop after printing _debug("2224");

function testPopup ($baseLink, $linkArr, $fileUrl) {
if (_isVisible(_link($baseLink))) {
for (var $i=0; $i<$linkArr.length; $i++)
var $waitForMaxSec = 0;
while (($waitForMaxSec == 10) || (_lastDownloadedFileName() != $fileUrl[$i])) {
$waitForMaxSec += 1;
if ($waitForMaxSec >= 10) {
_assertTrue(false, "File is not present");


  • If I play it manually it runs fine, but if i leave the controller and don't press play button.

    I am getting this error

    Window/Domain not found: popupNameFromStep=popWin; derivedName=; windowName=; windowTitle=GE Funds | Literature | Prospectuses & Reports; wasOpened=0; domain=
    --Stopped Playback: FAILURE--

    Is it because focus is not on this window? any solution?

    FYI: when i click from the base window, one pdf also gets open along with this popupwindow (i suppose on load of popup). But this pdf is getting saved under donload dir of SAHI.
  • Hello,

    am also facing the similar issue, in my application if i click on Add button it opens the popup(another page) where i need to enter many details and upon saving that popup it should redirect to the original page.

    I recorded the script for the same but it is getting failed to read any component in the opened popup, i observed that while recording the popup index was popup("1487790353_36"). and while running the script the same popup is shown as popup("1171996449_60")

    we are using JSF framework, which will genrate the random number for each time.

    Can anyone please suggest me the solution
  • narayannarayan Administrators

    Your problem is not the same as Rakesh's. Instead of using the random number, use the title of the popup window.


  • Hi Rakeshsilswal,
    Which browser and which version of Sahi build are you using?

    Browser type with version:
    Sahi build version: (you can see this on the top right corner of the sahi controller)
  • narayannarayan Administrators
    Hi Rakesh,

    The error says popWin not found, but another window with title "GE Funds | Literature | Prospectuses & Reports" was found. Could you try using _popup("GE Funds | Literature | Prospectuses & Reports") instead of _popup("popWin")?

  • Hi Narayan,

    Thanks for looking into this issue. Following is required info.

    SAHI Build: 2010-11-03
    Browser - IE v8.0.6001

    "GE Funds | Literature | Prospectuses & Reports" is a title for parent screen. I dont think I can use this title in popup to access popup screen. Please comment if i am missing anything.....

    Code that opens popup from parent is like this.
    newwin =,"popWin",winOpts);

    And title of popup is "Literature", i tried using that as well, but same result as popWin (Script halts, but when I manually click play again, it just work fine).
  • narayannarayan Administrators
    Hi Rakesh,

    You are right about the window name. If you are fine with it, we can set up a desktop sharing session to see what is happening. Would that help? Please email to set it up.

  • Hi Narayanan,

    i tried to use _popup("yourPageTitle") but it is not working, i observed that my first page's page title and the popup screen(the second screen that opens when i click on add button) has the same page title

    Can you please suggest me some other property which i can use

    Thanks &Regards,
    Paida vamshi
  • hi,

    I got it running finally.

    i tried _popup("/.*/") and somehow it correctly got the hold of popup window.

This discussion has been closed.