Forum Discussion
this is my solution:
(mcModul holds the Name of the module)
Sub WaitUntilClosed(DialogAlias)
' waits until dialog disappears
Const cRoutine = "WaitUntilClosed"
Dim Ix
Dim vorhanden
Dim Timeout
Dim Caption
' shorten delaytime to use .exists in script extension: set Options.Run.Timeout to 200
Set Timeout = SetRuntimeoutObj(projectsuite.Variables.LoopMs)
' Dialog not available
Caption = ""
vorhanden = DialogAlias.Exists
If vorhanden Then Caption = DialogAlias.wndCaption
Ix = ProjectSuite.Variables.LoopStart '10
If vorhanden then
Do While Ix > 0 And DialogAlias.Exists = True
If Not DialogAlias.visible Then Exit Do
Ix = Ix - 1
'Delays the test execution for the specified time period.
Call Delay(ProjectSuite.Variables.LoopMs) '200
' Das Speichern kann etwas länger dauern, ggf. Cursor abwarten
' nice to have
' If Ix = ProjectSuite.Variables.LoopStart - 1 Then
' PVA_0.Cursor.WaitUntilReady
' End If
Loop
End If
' reset delaytime to 10000
Timeout.Restore
' Checkpoint
If Caption = "" Then
Caption = "Dialog"
Else
Caption = "Dialog " & PVA_0.Basis.NameWrap(Caption)
End If
If Ix <= 0 then
log.Error Caption & " wurde nicht geschlossen", _
(ProjectSuite.Variables.LoopStart - Ix) * ProjectSuite.Variables.LoopMs & "ms" & vbCr & mcModul & cRoutine
Else
Log.Event Caption & " wurde geschlossen", mcModul & cRoutine
End If
End Sub