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 Capture events from Child Browser window

RoshiRoshi Members
edited May 2011 in Sahi - Open Source
Hi,

I am having trouble in capturing events from child browser window, If the child browser window invoked from parent browser by clicking some of the buttons,links,etc in parent browser window..

Here We go the scenario details:

1. Invoke app in Browser.
2. Click on link in parent browser window
3. Child window opens
4. Provide inputs in child window
5. Close child window
6. work on parent browser window again

Could some one please help me out in this regard.

Thanks,
R

Comments

  • RoshiRoshi Members
    Does any one have a solution for this in Sahi?
  • zerenzeren Members
    hi Roshy,

    Are you using Sahi v35?
    me too having issues with child browser. For me sahi works individually on parent and child windows, but when I combine scripts (click from parent , open child and verify child objects) sahi controller gets stuck and shows time out.

    some body pls help !
  • narayannarayan Administrators
    Are these 2 windows opening pages from different domains?
  • zerenzeren Members
    they are from same domain
  • RoshiRoshi Members
    In my case, Child browser window opens up from same domain and child window will not have any browser menu options.which is like popup in browser.
  • narayannarayan Administrators
    Hi Roshi and Zeren,

    Please create separate posts for each of you (unless you are from the same team).
    It helps us follow and address the issue better.

    Give us clear reproduction steps, with sample code. Both your cases work in normal circumstances.

    Regards,
    Narayan
  • RoshiRoshi Members
    Hi Aryan,

    I am unable to capture Child _popup browser window events

    Here We go the scenario details:

    1. Invoke app in Browser in Parent window.
    2. Click on link in parent browser window.
    _click(_link("My Plans"));
    _click(_link("Assign/Modify % of Focus"));
    3. Child window open as browser popup, without browser menu options
    4. Provide inputs in child window.
    -Unable to capture events from here in sahi
    5. Close child window
    6. work on parent browser window again

    Could you please help me out in this regard.

    Thanks,
    Roshi
  • ajithshimpi007ajithshimpi007 Members
    edited November 2011
    hi, to capture events from child window ..

    1. U stop and close the sahi controller
    2. Reopen the sahi controller with the same script name as previous but by pressing the Alt + double click on the child window ...only then u can be able do actions on child window.

    hope this is the answer if i hav got the question correctly..
  • Hi,

    Thanks for the response!!!

    Problem resolved to get the object properties on Child Browser window. Which helped to generate script.

    But, Script is not running successfully, As It's not recognizing Child browser window objects while run time. As it's not worked with even _popup("/.*/")._click(_link("XXX")); script as well.

    Please do let me know If you have any workaround on this.

    Thanks,
    Roshi
  • Hi Roshi,

    _popup("/.*/")._click(_link("XXX")); This will not work because in _popup("popWin"), "popWin" will be stored on the parent window from where the popup was been launched.It wont understand if you mention the popup id in regular expression.

    You can use regular expression when the popup id's are changing.

    You will have to use it as:

    _popup("popWin")._click(_link("XXX"));

    Regards
    Sumitra
  • Hi,
    Did you get a solution to your problem? I am having the same issue..
Sign In or Register to comment.