18 January 2026:


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.

Sahi popup window

Tanna1Tanna1 Members
edited August 2013 in Sahi - Open Source
Hi,
My application has several popup windows opening from javascript validations. Sahi is not recognizing those. If i manually add it like
_popup("windowTitle"),
It says no such window found. The windows are not javascript popups but normal html pages opening as popups.
Plz help.

Answers

  • the exact error message is: _popup("Error Window")._click(_button("CERRAR")); Window/Domain not found: popupNameFromStep=Error Window; derivedName=; windowName=; windowTitle=Happy Time; wasOpened=0

    Here the title it is recognizing is actually the parent window title.
  • Pratyush_TytoPratyush_Tyto Members
    edited August 2013
    Hi Tanna,
    What do you get in the prefix tab of the controller, when you ctrl over(try to find accessor of) any element on the opened popup window?

    Regards.
  • if you find the text as:
     _popup("<your_title>")
    

    you can use the following command.
    _selectWindow("<your_title>");
    

    Also, if you would like to perform some action i.e. lets say clicking a button in the opened popup,
    You can use the following code:
     _popup("<your_title>")._click(_button("<your_button>));
    

    For details about how to use the above mentioned APIs,
    search for _popup and _selectWindow in the following page:
    http://sahi.co.in/w/all-apis
    

    Regards.
  • Hi,
    control hower doesnot happen on the popup window. It comes when some error happens.

    _selectWindow() or _popup() hence do not work.
  • Hi,

    Perform the action which causes a error and hence the popup on the sahi browser manually. Bring up the controller, from which you can get the exact popup name.
    Once you get the popup name, you can use the above code suggested by Pratyush

    i.e
    _popup("<your_title>")._click(_button("<your_button>));
  • its an internal application.. its not an alert.. I will tell you the 2 kinds of popups:

    1) onclick="javascript:LoginClear(document.Login)"

    2)onclick="Javascript:openWindow('../SECURITY/PCSEC_PROCESS.jsp')"


    If it is the 2nd case, the window opens as the name is visible in the code.. But the window which comes due to 1st case is not recognised.

    I cannot give the URL as it is an internal application
Sign In or Register to comment.