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.

Not able to perform actions on another/child window.

nagarnagar Members
edited June 2012 in Sahi - Open Source
Hi All,

According to my test scenario, I start with a http page, then after performing some actions on that page, I navigate to a https page. There, I click on a link from the https page, which opens in a new window. I want to perform some action on this window and then want to close it.

Once it is closed, I need to navigate back to http page from https page(base window).

My script is running fine, except performing action on that new window and closing it.

When I run the script, it navigates to https page, click on link and opens a new window. Then without doing anything (not even closing) on this window, control moves on to base window and navigates back to http page.

I have tried:
(new window does not have any title).

_popup("")._click(_link("abc"));
_popup("").closeWindow();
_popup("").close();

browser.popup("").close;

_keyPress(document.body, 115, "ALT"); //for pressing ALT+F4


But nothing works.

Note: This new window does not show _popup() as prefix on Sahi controller, so may be it should not be treated as popup, but _popup("").close(); works from Sahi controller during debugging. During run time, it does not work.


Kindly help in this problem.

Regards,
nagar.

Comments

  • nagarnagar Members
    I am still stuck on this issue. Please help me.
  • nagarnagar Members
    Someone please look into this.
  • KarenKaren Members
    I met similar problem. When opening a new window (window2 from a link in window1), Sahi controller doesn't record anything as prefix of window2. Even hover on it, there is no prefix displayed in controller. The recorded scripts also has no _popup prefix. But when replay, action in window2 will fail.

    So, my question is "How come Sahi opens a new window but doesn't record prefix of it?" "And, how to locate elements in such new window?"

    Thanks!
  • hi,
    for my application, when i click on the login button application will open in a new window. this new window is not loading while running through SAHI, if i login into the application manually, then the new window is loading.why is this happening and what is the solution for this.

    thanks in advance.
Sign In or Register to comment.