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.

Handling popup's in sahi script

rajathummalarajathummala Members
edited November -1 in Sahi - Open Source
Hi Sumitra,

Can we handle pop up's in Sahi, if so could please explain me how can we handle popup's.

Please provide me the details elaboratedly, if you have links for this topic. please post it.

Does Sahi support tabbrowsing in browsers((IE,Firefox & chrome..etc), if so please provide me complete information...

Thanks for your as usual support...:)


Regards
Raja

Comments

  • Hi Raja,

    Yes, Sahi handles popup using an API called _popup(identifier).

    Here the identifier could be the windowName or windowTitle.
    Returns a handle to the window. The identifier can be a regular expression.
    _popup() is used as a prefix to statements which need to be executed on another window.

    Eg. _popup("popWin")._click(_link("Click me"));
    _popup(/popWin.*/)._click(_link("Click me"));
    _popup("Window Title")._click(_link("Click me"));

    Also, have a look at: http://sahi.co.in/w/all-apis

    Let me know if you face any problem.

    Regards
    Sumitra
  • Hi Sumitra,

    Thanks for you reply...

    Please clarify me below doubt as well..

    Does Sahi support tabbrowsing in browsers((IE,Firefox & chrome..etc), if so please provide me complete information...

    Appreciate your prompt response...

    Regards
    Raja
  • Hi Raja,

    Yes, Sahi does support tabbrowsing in browsers. Sahi wil handle it as _popup(identifier).

    Regards
    Sumitra
  • Hi Sumitra,

    Thank you very much for you response..

    _navigateTo("http://www.greatandhra.com";); when we navigate to this site , it will list out all the links, but i want to open one link in another browsing tab of the same site (Tab Browsing).

    Please help me out from this issue..




    Regards
    Raja
  • Hi Raja,

    You can do something like this:

    window.open(_link("Chandrababu's 'T'imid, 'D'ud And 'P'ity Act").href,"andra");

    Regards
    Sumitra
  • nagarnagar Members
    Hi,

    I am also facing this issue.

    I am not able to perform any action on the popup window. There are different popups from different domain, so popup title is dynamic or may be blank.

    I am trying with
    _popup("/.*/")._click(_link("xyz"));
    _popup("/.*/").close();

    But it is not working. Neither clicks on link, nor closes the popup window.

    Please help.


    Regards,
    nagar
  • TheeranTheeran Members
    Hi Nagar,

    Can you specify how Sahi records the step?

    Using it,we can know what the window name is and what expression can be used to identify the window).

    Do the dynamic window names follow any pattern?

    Thanks,
    Theeran.
Sign In or Register to comment.