Results 1 to 3 of 3
  1. #1

    Using the \'Wait\' command for events

    Has anyone else come across the issue of using the Wait command for events. Below is a simple script using the Wait command

    Option Explicit
    Sub Main()

    'Insert code here

    Dim myAppid As Integer
    Dim bLoop As Boolean
    bLoop = True

    While bLoop = True

    myAppid = Shell("notepad.exe", vbNormalFocus)

    If Wait(5, "NotePad Window") = True Then
    MsgBox "Event passed."
    ' Generated Statements

    Window("Untitled - Notepad Window").Attach
    MsgBox "Timeout of 5 seconds has been exceeded."

    End If


    End Sub

    Testpartner sees the event as having occurred when we enter the lop for the first time, however, on returning the second time it thinks the event has not occurred, even though you can see the event with naked eye as having happened. I am currently using v 5.0.4. on win 2000 sp1 and sp2, And considering that events are an integral part of test automation especially for gui apps, doesn't this seem odd that this is happeneing

    Any clues as to why this is happening, as I have my own theories on this anyway would be appreciated, or any work arounds without having to code my own generic synchronization functions would be very helpful.




  2. #2

    Re: Using the \'Wait\' command for events

    According to Compuware, there is a bug where a "Wait" event can only be triggered once within a given script. Logically, you should be able to use "Wait" events more than once in a script, and I have been told that this bug should be fixed in the next version of TP. Meanwhile, you may want to rework your script to use a "whenever" event instead. I have found that even though this is less efficient, it can be triggered many times within the same script.

  3. #3
    Junior Member
    Join Date
    Feb 2002
    Tel-Aviv, Israel

    Re: Using the \'Wait\' command for events

    You might want to reffer to the solution posted by Sini under the subjec "Wait Events for Web Testing".
    It has solved mine!!


    [This message has been edited by cohen kfir (edited 10-03-2002).]



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 07:15 PM.

Copyright BetaSoft Inc.