SPONSORS:






User Tag List

Results 1 to 9 of 9
  1. #1
    Senior Member
    Join Date
    Jun 2002
    Posts
    119
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to close a pop up browser window?

    The web app that I'm writing test scripts for has several buttons that bring up what I'll call popup windows. That is, in IE a separate window comes up on the screen that DOES NOT have all the toolbars and buttons at the top, just a window frame (it does have a title bar with Minimize-Maximize-Close buttons like any Windows frame).

    Right now I just want to verify that our "Help" comes up when the button is clicked. No problem there, but how to get it to close? Calling

    [ ] HelpWindow.Close()

    gets an error: "Function Close is not defined for window HelpWindow." It seems I need to get at the Browser parent behind the BrowserChild that's being called HelpWindow, captured with Record Window Declarations.

    I tried Browser.Close(), but that just closed the main IE window and left the HelpWindow open.

    I looked in the Library browser for other possible functions. I found that

    [ ] Browser.Click (1, 10, -8)

    would get the dropdown SysMenu for the windowframe, and right there is the "Close" MenuItem that I want, but I can't get it to click on it. The results says

    Error: Window '$PopupStart/[MenuItem]Close' is not active

    I tried SetActive(), and was told it's not defined for the Close menu item.

    I tried everything I could find/think of.

    Any help?

    ------------------

  2. #2
    Member
    Join Date
    Sep 2002
    Location
    Chicago, Illinois, USA
    Posts
    90
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to close a pop up browser window?

    try Typekeys("<Alt-F4>")

    ------------------

  3. #3
    Senior Member
    Join Date
    Jun 2002
    Posts
    119
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to close a pop up browser window?

    Magic!

    Now why didn't I think of that? A few weeks back someone suggested I use TypeKeys("<Tab>") as a way to navigate to a textfield that wasn't responding to SetText().

    I hope I remember this lesson!!

    Thank you so much!

    F

    ------------------

  4. #4
    Member
    Join Date
    Jun 2001
    Location
    Berkeley, CA, USA
    Posts
    67
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to close a pop up browser window?

    Another good method is

    window.CloseBox.Click()

    ------------------

  5. #5
    Senior Member
    Join Date
    Dec 2001
    Location
    Bozeman, MT, USA
    Posts
    265
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to close a pop up browser window?

    for some reaon segue is using what I will call a 'weak' close method for the IE browser window. I had to modify my basestate to account for these 'popup browsers' as you call them that do not have a menu bar. The menubar is the important item here because if you dig into the explorer.inc file you will find that the close method for IE browsers is to do a File->Close.

    I wasnt aware of the CloseBox method bruce has described here. If it works, I may replace the File->Exit in my explorer.inc with that as I feel the closebox is a much stronger close method and doing an <Alt-F4>(which I am currently using for these popups) or a File->Close.

    ------------------
    Ryan McCullough
    Accelrys Inc.
    ryan@accelrys.com
    Ryan McCullough
    RightNow Tech. Inc.

  6. #6
    Senior Member
    Join Date
    Jun 2002
    Posts
    119
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to close a pop up browser window?

    I had concluded that File/Close was what was normally used, so it didn't do it for the popup. I seem to remember trying CloseBox yesterday as I tried everything that seemed reasonable in the Help. I'll check it today at work.

    Thanks, all

    F

    ------------------

  7. #7
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to close a pop up browser window?

    Excellent! I was also unaware of the CloseBox method. I've run into this File/Close issue with Explorer where the menubar was hidden as well. Thanks Bruce!

    ------------------

  8. #8
    Senior Member
    Join Date
    Jun 2002
    Posts
    119
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to close a pop up browser window?

    CloseBox doesn't work here, but the Alt-F4 is fine.

    ------------------

  9. #9
    Senior Member
    Join Date
    Dec 2001
    Location
    Bozeman, MT, USA
    Posts
    265
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to close a pop up browser window?

    I just tried the CloseBox.Click() method and it doesnt work. It would probly work if you defined your browser like a mainwin and didnt use the browser extensions.

    ------------------
    Ryan McCullough
    Accelrys Inc.
    ryan@accelrys.com
    Ryan McCullough
    RightNow Tech. Inc.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:28 PM.

Copyright BetaSoft Inc.