Forum Discussion
Dmitry_Nikolaev
Staff
14 years agoHi Ory,
The Object not Found errors are test execution errors and they cannot be handled by the VBScript exception handling feature. I suggest you moving the timeout into the procedure that searches for the CMD window. Please let me know if this works for you.
...
'The following line clicks the Run ESL script in an Asynchronous manner (which proved to be faster)
Call Runner.CallObjectMethodAsync(Aliases.CardSharkCryptoSW.dlgCardShark.RunESLScriptBtn, "ClickButton")
'Getting the ESL CMD Window
Set ESLCMD = GetESLCMD
'If ESL CMD windows is not found...
If ESLCMD is Nothing Then
...
Function GetESLCMD
Dim CMDwText, CMDWindows
Dim Timeout, EndTime
Timeout = 10000
EndTime = GetTickCount + Timeout
Set GetESLCMD = Nothing
' Try to find the ESL CMD window within the timeout period
Do
'Finding all matching CMD Windows
CMDWindows = GetCMDWindows
'Checking that a CMD Window has been found
If Not isNull(CMDWindows(0)) Then
'Go through found windows and find the ESL Script one
For i = 0 To UBound(CMDWindows)
CMDwText = CMDWindows(i).wText
If InStr(CMDwText, "C:\AFC\cardshark\CardShark 30.8.0004.sea>set ESLPATH=config\ESL\sea") <> 0 Then
Log.Message("ESL CMD Window found")
Set GetESLCMD = CMDWindows(i)
End If
Next
End If
If EndTime < GetTickCount Then
Exit Do
End If
Loop While GetESLCMD is Nothing
' Check whether the window was found
If GetESLCMD is Nothing Then
Log.Error "ESL CMD window is not found"
End If
End Function