SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3

Thread: Whenever clause

  1. #1
    Points for Confirmed Friends
    Guest

    Whenever clause

    I need some help with using the Whenever clause. It doesn't work.
    The code below is what I am running.
    The application-under-test issues a dialog box when the application is ready to time out. This dialog box has a two pushbuttons. The user has the option to maintain the connection or sign off by pressing the corresponding pushbutton. The user presses the Maintain Connection pushbutton to keep the connection alive. The code I have written sets up a MakeEvent for the existence of the dialog box, and sets up a Whenever clause to call the MaintainConnection function which presses the Maintain Connection pushbutton. When I run the script it doesn't recognize that the window (dialog box) exists, so the MaintainConnection function never gets executed. Why not?
    ________________________________________
    include ''OLP1.Include'' //MaintainConnection function code is in here
    Function Main

    //Test maintainconnection logic
    Timeout = MakeEvent ( ''window'', ''~N~WM32.EXE~#32770~Westlaw Time Out'', ''exists'' )

    whenever Timeout call MaintainConnection

    Suspend

    End Function ; Main

  2. #2
    Points for Confirmed Friends
    Guest

    Re: Whenever clause

    Hello,
    With the information provided, I think your problem is that the window name has altered. Try using Activewindow name instead of recording a specific window name.

    Simon Wellington(OCS Consulting)

  3. #3
    Points for Confirmed Friends
    Guest

    Re: Whenever clause

    Hi Kathy

    Your script will not work because you are assinging a variable the value of the MakeEvent but are doing nothing with it. Your best bet would be to use QARun's own Event Map functions and define the event outside of the script. You can do this by selecteing Insert~Event fromt he editor's main menu options. The resulting code would look similar to the following:

    Function Main

    //Close Down is a Window Event defined using the Insert~Event
    //option from the editors main window. It defines the existance
    //of the window
    Whenever ''Close Down'' Call OnCloseDown
    Suspend

    End Function ; Main

    //This function can be called by the INCLUDE FUNCTION if
    //required

    Function OnCloseDown
    ;
    ; Function to handle the event 'Close Down'
    ;

    Attach ''Lotus cc:Mail PopupWindow''
    Button ''&No'', 'Left SingleClick'

    End Function ; OnCloseDown


    I have added the comments afterwards.

    Hope this helps.

    Compuware Corp


 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 13.64%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin 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 10:06 AM.

Copyright BetaSoft Inc.