I am new to TP and your help on the issue I am seeing would be of great help.
I have created a Window Event (Create Event for all windows).
I notice that when a window is created newly during the test, it is going to Script_Whenever and executes the command given in that function but does not go to the main script after the command ResumeScript. It continually agains comes back to the Script_Whenever function after ResumeScript.
Code is here:
ret = Whenever("Test")
ret = false
if ret = True Then
Private Sub Script_Whenever()
ret = False
Not sure if this is bug or a feature... I recreated this and if I step through it, it ends up triggering the whenever even if no windows are created. If I leave it running it will eventually close all open windows.
Not sure if that is what you are seeing, sounds similar. I think that you should change your windows create event to use a wild-carded attach name so that it only looks for windows from the app under test or certain classes of popups. It still may not work as you would like, you may need to find a different way to handle these.
IMO using whenever's is prone to problems. Unless the window is truely random, you should be able to just create a function to check for extra windows to close and call it where appropriate.
A problem is a difference between what is perceived and what is desired, that
we want to reduce (Dewey 1933)