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.
Open a new popup window with sahi
Hello averybody, does anyone tried to open a new popup window from sahi code to make some calculation in it and return to the main testing page?
I tried _call() function and it worked, but opened another 2 popups of controller!
What is wrong with this code?
_call(window.open("http://www.w3schools.com"
);
I tried _call() function and it worked, but opened another 2 popups of controller!
What is wrong with this code?
_call(window.open("http://www.w3schools.com"
Comments
Your code is fine. Sahi will open 2 controllers when the opened domain is different from the original domain. You can just close both the Controllers and invoke (Alt-DblClick) on the window you want.
If you pass in a window name too, like this,
_call(window.open("http://www.w3schools.com", "calcWindow"));
Sahi will be able to identify the new window as _popup("calcWindow")
Regards,
Narayan
I have managed to use the popup (open/operate/close) as you sad, but is there the way to close another two popups (one of them is blank) of controller of a new domain (they don't even have a title)?
I have 1200 test cases and for each of them I should calculate the fiscal code of a person in separated popup. If they remain opened, at the and of the test the memory of my pc would be saturated for thousands of instances of the browser...
Thanks again
When you run a script as part of a suite file, the Controller is not opened.
If you run your script as part of a suite file, you won't get the Controller popup. As you have 1200 test cases, it's better to run as a suite file. So, you need not to run 1200 test cases manually, and Sahi will take care of closing all the necessary browser instances once each test is over.