I have a window event which checks for the presence of a confirmation dialog box.
When I use the event with a wait option, the event is triggered successfully. However if I use it with 'whenever' the event is not triggered. I've read several topics on this site where people have had similar problems but there doesn't seem to be a definitive answer. The event seems to be fine given that it is recognised when given a wait option. A sample of what I am trying is below. Does anyone have any ideas as to what is wrong ?
If Wait(1, "cancel_restart_window_batch", tpWaitSeconds) = True Then ' This statement is always triggered
TestLog.Comment "Event triggered"
TestLog.Comment "Event did not trigger"
End Sub ' This code is never entered
Private Sub Script_Whenever(ByVal TheEvent As TPEvents.TEventGroup)
' Attach to QuickAddress Data Setup Window
Window("QuickAddress Setup Window").Attach
I changed this to a screen event and moved the 'whenever' to the top of the subroutine. It worked a few times but is now back to the same behaviour as initially reported (which is wierd).
Is there an equivalent of "whenever" which I can code ?
I had the same problem with the whenever events. After many calls with the support desk, I moved the whenever event to sit just above the code which 'should' cause the event to occur. I had to add a long pause afterwards too - around 5 seconds, to ensure TP had time to think about (then open) the whenever event code.
I also had to change the property of the whenever event to be 'create', not 'exists' or any other option.
This caused the whenever event to be triggered - however, I've now got the problem where TP won't exit the "Sub Script_Whenever".
I am currently waiting for a date to show this to development support (in the US)...but will update this forum with any progress.
We experienced similar problems where our Whenever and/or Wait commands would sporadically work. By that I mean our Whenever/Waits would either trigger when they were not supposed to or not trigger when they should have.
Our problems seem to have been resolved by loading Service Pack 3 for TestPartner.