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.

popup window exist or not

dkdk Members
edited November -1 in Sahi - Open Source
Hi
Is there an api to check if popup window Exist or not?
Popup opens by _click(_link($name)); So I wont get a handle as I am not using javascript to open poup.

Thanks

Comments

  • narayannarayan Administrators
    Hi dk,

    _popup can use either the window name or the window title. If you hover over the element, the controller should populate the "Prefix:" field with the correct "_popup" identifier.

    Btw, if the link has a 'target="someName"' attribute, someName would be the name of the window.

    Regards,
    Narayan
  • the problem I face with this...
    window name is dynamically generated
    i.e. in some cases I get:
    Sahi Prefix: _popup("TableClass_49").
    Sahi Prefix: _popup("TableClass_66").
    Sahi Prefix: _popup("TableClass_3").
    etc...

    and if I use the Window Title instead,
    Sahi Prefix: _popup("Table Class Title Page").
    The above is not unique, I can have multiple page with the same title...

    1 - would be nice to see Sahi to also implement the alternatives pulldown for Prefix/Window
    2 - is there a way to have a Sahi API that will kill all browser window/tab as a starting point? This way test is not confused as to which window must be run against.
  • narayannarayan Administrators
    Hi rj412,

    I think your problem occurs when playing back via controller. Older windows may be left open which can cause confusion in playback. (Could you please confirm this?)

    You could add

    _popup("/TableClass_/")._closeWindow();

    towards the end of your script to automatically close the opened window. You can use _popup("/TableClass_/") to identify the windows with changing suffixes.

    Regards,
    Narayan
Sign In or Register to comment.