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 switch between child and parent windows?
Hi
I have a list of reports in parent window (uses HTTP) . Each link opens to a SSRS report (HTTPS ) window.
I could record each window separately. But if I combine child and parent scripts together, controller could not identify child window elements.
Parent url: http://mydomain/reportlist
child : https://mydomain/report
Controller recognizes child window as _popup("windowname")
Expecting my script to work like this
_click(_link($reportName));
_popup("windowname")._assertExist(_span($reportName));
.....child window scripts.......
.....back to parent window....
How can I switch between parent and child windows when parent uses HTTP and child uses HTTPS ?
Thanks
I have a list of reports in parent window (uses HTTP) . Each link opens to a SSRS report (HTTPS ) window.
I could record each window separately. But if I combine child and parent scripts together, controller could not identify child window elements.
Parent url: http://mydomain/reportlist
child : https://mydomain/report
Controller recognizes child window as _popup("windowname")
Expecting my script to work like this
_click(_link($reportName));
_popup("windowname")._assertExist(_span($reportName));
.....child window scripts.......
.....back to parent window....
How can I switch between parent and child windows when parent uses HTTP and child uses HTTPS ?
Thanks
Comments
http parent window opening https child window works fine on IE8 and Firefox 3.6
Which browser are you using?
When you specify a _popup("xxx") it targets the xxx child window.
If you do not add any _popup prefix, then it points to the parent window.
Regards,
Narayan
So I changed SAHI properties to accommodate more delay in steps.
Now its working fine.
But only thing I have to do is to open the controller on child window to identify its elements. Again, close and open the controller on parent window to identify parent elements.
This is noticed only in HTTPS child window.
I had another scenario of parent and child using same protocol, then never had to open and close controller on each window.
Thanks a lot to Narayan for looking into this.
How about If both window's are http based?
parent: http://mydomain/reportlist/subreportlist00
child: http://mydomain/reportlist/subreportlist11
Thanks,
Roshi
If the Parent window and the Child window's URL are http then Sahi will prefix the child window with _popup and will run the scripts.
You can find the sample script in <sahi-home>/userdata/scripts/demo/popup_title_name_mix.sah
Here is a simple example:
Let me know if you face any problem.
Regards
Sumitra