SPONSORS:






User Tag List

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Sep 2001
    Location
    Pepperell, MA, USA
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Dealing with unexpected dialogs

    Is there a tried and true method for dealing with dialog boxes that may popup at any time during a test? I get a login dialog at fairly irregular intervals. I have added checks in my scripts for it everyplace I can think of, but I've had tests fail on a call to SetText() because the window was not active when the immediately preceding statement was a setactive().

    What I need is a way for a small piece of code to get invoked automatically whenever a window is created. Visual test can do this, but apparently 4test requires a call to DoEvents to make this work. I also tried creating a second thread, but the scirpt does not switch threads often enough.

    So what I think I need is either a way to write my own generic exception handler that can somehow apply to all exceptions and conditionally re-execute the statement that failed, or a way for a the OnWindowCreate to work automatically, not just when DoEvents is called.

    Any ideas anyone?

    JLM

  2. #2
    Guest

    Re: Dealing with unexpected dialogs

    Try declaring the dialog and type in your

    TestcaseEnter ()
    DialogName.SetTrap ("Button Tag to Press")



  3. #3
    Guest

    Re: Dealing with unexpected dialogs

    You said that you want to fill in a few fields before you click a button...

    This becomes a little trickier....

    The only way I can think of doing this is by finding where the SetTrap method is in the 4Test includes and add in code especially for your dialog. Meaning if the dialog I'm in is the dialog that I'm looking for then fill in these fields and continue. Or another way is you can create a new window class and have that declared dialog which pops up of that type, then override the SetTrap () method.

    I'm not sure the last solution would work, but I know the 1st one is not portable from one system to another unless you copy that same .inc file over.

    I hope I didn't confuse you further.

    -AJ Alhait

 

 

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

Copyright BetaSoft Inc.