SPONSORS:






User Tag List

Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    May 2002
    Posts
    448
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unable to dismiss unfriendly dialogs

    Intention:
    More than a single dialog is invoked in an application. I need to dismiss all except the MainWindow. Most of the dialogs are modal.

    Problem:
    I am able to dismiss the first (top most). After I dismiss the first one I need to get the next window active for the Application Under Test and dismiss it.

    I have tried the following:
    Desktop.GetActive ()
    Desktop.GetChildren ()
    MainWin.CloseWindows ()
    MainWin.GetCloseWindows () and MainWin.GetNextCloseWindowExample ()

    Sometimes the GetActive call returns one of the controls within the window as active. For e.g. a PushButton or RadioList. For this I tried
    CurrentActiveWindow.GetParent () to get the dialogbox to dismiss. the call fails. Also tried it with the wParent property.
    The GetAcitve call sometimes returns one of the Parent Dialogs as active. Even though the child dialog is still present. Problem is the dialogs are modal.

    Also wrapped up all the calls above in a Do Except. None seems to help.

    SilkTest 5.0.3.2 (Client does not want to upgrade), Win2k, application is a Windows Desktop.

    ------------------
    never say die
    Life, that dares send, A challenge to his end,
    And when it comes say, Welcome friend.

  2. #2
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Unable to dismiss unfriendly dialogs

    What kind of app' is it? (ie: "Windows Desktop" ?) A native window app (C++-based)? Or have you replaced the normal desktop?

    A loop using GetNextCloseWindow() is usually reliable with native window's apps however Java requires some "creativity" to identify and deal with modals.

    Using Typekeys("Alt-F4") is much more reliable than Close().

    Note that being Minimized can hide modals and block a close routine.


    John


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

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

    Re: Unable to dismiss unfriendly dialogs

    John,

    The app is developed in VC ++. The GetNextCloseWindow (), or any other (GetActive, GetChildren) calls fail, I guess the reason being that the window that is active is either a control within the dialogbox (sometimes the parent and not the one that is currently on top) or maybe the parent dialog itself. I have no idea why this is so.

    I thought the reason must have been the declarations that were created. Since in many of the dialog declarations I have elevated the controls (pushbutton, Radiolists etc) of the child dialog to the parent by appending the tags. But I cross checked this and I am absolutely sure that this is not the problem.

    I also tried the Typekeys ("<Alt-F4>"), but tried it on the window returned with the GetActive or GetChildren call. Still nothing.

    Now I think I will try out this, I will wrap up the GetCloseWindow and GetNextCloseWindow calls in a do except loop. In the except I will dismiss everything with a Desktop.Typekeys ("<Alt-F4>") until only the Main win is left.

    One other thing, sometimes the active window returned from the GetActive calls is a window which is not present at all. I don't know how to handle this one.

    ------------------
    never say die
    Life, that dares send, A challenge to his end,
    And when it comes say, Welcome friend.

  4. #4
    Senior Member
    Join Date
    Jul 2001
    Location
    Brookline,NH USA
    Posts
    147
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Unable to dismiss unfriendly dialogs

    Sometimes the simplest approach can do the trick -- here's some pseudo-code:May need a little massaging, but it's worth a try...

    ~ Fred

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

  5. #5
    Member
    Join Date
    Feb 2005
    Location
    Bangalore, India
    Posts
    303
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Unable to dismiss unfriendly dialogs

    I have used isactive instead of Exists... it worked faster
    [-] while (MainWin.isactive() == False)
    [ ] Browser.CloseWindows(TRUE)

    Let me know if there is any problem in using Isactive instead of Exists in this scenario

 

 

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:30 AM.

Copyright BetaSoft Inc.