18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
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
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
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
I got the solution of the above query.
Thanks
_popup("windowtitle").close();
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