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.

How to close a popup window

Merajul HaqueMerajul Haque Members
edited November -1 in Sahi - Open Source
Hi..

I am trying to close a popup window using the following api:

_popup("UserDialog")._closeWindow("WK849975");


Sahi considering the window name 'UserDialog' where as the window title name is 'WK849975'.

but the the window is not getting closed. I tried in both way taking the window title name & Sahi considered name but its not working.

Following is the API I used to close the popup window:

_popup("UserDialog")._closeWindow("UserDialog");

_popup("UserDialog")._closeWindow("WK849975");


Is the any command in sahi for hotkeys like ALT+F4 to close this popup window. If so could you pls refer the url or else for hotkeys where I can find these.



Thanks

Comments

  • Hi.

    I got the solution of the above query.

    Thanks
  • sunnysunny Members
    i used the following code and it worked fine.

    _popup("windowtitle").close();
  • JithinJithin Members
    Hi
    I used the following code for closing popup window and return back to the previous window
    _selectWindow("windowtitle"); //Selecting the popup window
    _closeWindow(); //Closing the selected window
    _selectWindow(); //Selecting the previous window
Sign In or Register to comment.