Hi folks,
I've also got a solution for this task, see attachment.
I'm sorry, it is written in german language.
It is a class in a script extension, and it is used as follows:
' set Your timeout
Set Timeout = PVA_0.TC.SetRuntimeoutObj(projectsuite.Variables.WaitExMs, mcModul & cRoutine)
[object var ] [script [new timeout in ms] [name of originator ]
extension namespace, module, routine]
' reset to previous timeout
Timeout.Restore
It comes with some advantages:
- it can be used hierarchically in subroutines
- Timeout is also reset automatically as soon as the object variable is destroyed after the defining routine is left.
- it comes with a threshold (german: "Schwelle") for reduction: only if the reduction is more than a certain factor, it is executed. This is for performance issues, as on my pc, changing the auto-wait timeout requires 4 ms of time
- the routine name of the originator is comprised for debugging purposes
The code is meant to be located in a script extension, so some global Objects have to be handed in when the test is started:
PVA_0.TC.Initialize Win32Api, Options
(locate in GeneralEvents_OnStartTest)
and has to be freed after stopping:
PVA_0.TcLog.Terminate
(locate in GeneralEvents_OnStopTest)
enjoy using it
Manfred