SPONSORS:






User Tag List

Results 1 to 9 of 9

Thread: Modal dialogs

  1. #1
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Modal dialogs

    I am having difficulty with modal dialogs in our application, and was wondering if anybody had any advice.
    Basically, SilkTest fails to spot that the modal dialog exists (checking with GetActive() and Exists()), and the testcase will fail, but the recovery system can't see them either of course, and so it has real difficulty. (The really annoying thing is that it can see the window perfectly in Record Window Declaration.)
    I have been assuming that this was just the way it was with my app, and getting round it with Desktop.TypeKeys("<space>") in order to press buttons on modal dialogs when they are supposed to appear.
    But I just noticed something in the 4Test reference, in the SetTrap() function description (p422), where it mentions using the tag "/~/$SystemModal" to deal with modal dialogs. Does this work generally? If so, how do I use it to define a normal tag for a modal window, so that SilkTest can see it properly?

  2. #2
    AJ
    AJ is offline
    Moderator AJ's Avatar
    Join Date
    Jun 1999
    Location
    San Jose, CA
    Posts
    1,691
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Modal dialogs

    if the dialogs are truly "Modal". Then you have no prayer to get automated. The onpy option you have is to beg the dvelopers to change it to Dialog or MessageBox.

    A Modal dialog is a class of MessageBox which suspends the system processor until dealt with. A True modal should only be invoked once a system failure occurs and yes there are guidelines on when to and when not to use them.

    The problem is when one appears, the processor is halted! No SilkTest nor WinRunner nor any ather app can run then until that dialog is dismissed.

    Some developers are what I call "Modal Happy", meaning they think thir messageboxes have to be dealt with... All I have to tell you about those is to either ask nicly or go to their managers and request they change it. It's simply a flag that can easily be turned off.



    ------------------
    AJ Alhait
    BetaSoft Inc.
    AJ Alhait
    BetaSoft Inc.

  3. #3
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Modal dialogs

    I don't mean that kind of extreme modal dialog; just the sort that pushes itself to the front of the application, and won't let the user change focus to any other window, thus ensuring that the user has to deal with that dialog before continuing to do anything else.

  4. #4
    AJ
    AJ is offline
    Moderator AJ's Avatar
    Join Date
    Jun 1999
    Location
    San Jose, CA
    Posts
    1,691
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Modal dialogs

    So they're called MessageBoxes

    You can do a settrap () for those if you like.

    Declare them, for example: MessageBox1 and in your main or in the ScriptEnter() function add MessageBox1.SetTrap("OK") <-- or whatever button you'd like to click.

    ------------------
    AJ Alhait
    BetaSoft Inc.
    AJ Alhait
    BetaSoft Inc.

  5. #5
    Member
    Join Date
    Jul 1999
    Location
    Raleigh, NC
    Posts
    35
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Modal dialogs

    Vince, there are two different types of 'modal' dialogboxes that I am familiar with.

    The first is 'application modal' where a dialgobox is invoked and the user cannot interact with the main application until the dialobox has been dismissed, but the user can still switch focus to OTHER applications. These should be easily dealt with via automation. Typically the developer creates them as a child of the main application, so your declaration for the dialgobox must have the correct parent. I have also seen developers create dialogboxes as a 'separte' app, it will show on the Windows taskbar and will NOT have the main application as a parent. This can still be dealt with but you have to modify your declaration a bit to ensure you're dismissing the correct dialogbox.

    The second is 'system modal' which is what AJ was discussing. One of the Quark apps (can't recall which) routinely invokes this type of dialobox and it truly is impossible to deal with in an automated fashion, everything (note: EVERYTHING) halts until you dismiss the dialogbox.

    Since the recovery system is having problems dismissing these 'modal' dialogboxes I would guess they aren't children of the main app or they are system modal.

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

    Re: Modal dialogs

    Vince,

    You've mentioned using SetActive() and Exists(). Try using a combination of IsEnabled() and GetNextCloseWindows() instead against the MainWin first, followed by ChildWins (if any) to identify the modal dialog.


    John


  7. #7
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Modal dialogs

    I would love to be able to use SetTrap(), or IsEnabled(), or GetNextCloseWindows(), but none of these are able to recognise the modal windows when they appear at runtime.
    As to what kind of modal window I am getting, I have checked and have confirmed that they are definitely children of the main application window.

    I repeat my problem - I know what kind of windows they are, I can do Record Window Declaration on them and get what appears to be a sensible declaration; but when it comes to runtime, it is as if silk simply doesn't see any modal window (they are full windows, with textfields that I want my script to be able to deal with in full, simply dismissing these windows is not sufficient); Exists() returns false, IsEnabled() returns false. GetNextCloseWindows() errors because even though silk can't see the modal window properly, it does realise that none of the windows it can see are enabled at all. GetActive() errors for the same reason.
    I have tried various changes to the window declaration for these modal windows, but nothing seems to help.
    From your responses, it seems that in most apps modal windows are simply not a problem and are dealt with by silktest in exactly the same way as any other window and as successfully; I was vaguely hoping that there was some trick to changing the window declaration, that wasn't documented.

    Just in case, has anybody else out there ever tested an application written in Visual Objects?

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

    Re: Modal dialogs

    Vince,

    Attach some example code and some abbreviated declaration files for us to look at.

    John


  9. #9
    Junior Member
    Join Date
    Jun 2000
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Modal dialogs

    Can you see the window with Silk after clicking on it? If yes, try to clik on it before you do anything maybe by overwritten SetActive() method. Disable any Agent_Verify* options before click.


 

 

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 09:07 AM.

Copyright BetaSoft Inc.