On Error Call
I am using VBS to script my scenarios. TC works on remote machine and reports me in realtime with emails cases when results are different from expected. I run about 300 cases daily and want to concentrate on important cases only.
I have problems with cases when TC fails to get throgh the whole scenario - test fails with an error (overlapping windows, no object found or tested application fails with a fatal error). Of course there is info is the tests' log, but I created mail reports to avoid reading throgh 300 cases logs. Which cannot be reached while tests are going on anyway (12 hours or so, 5 am - 5pm).
Is there a way in TestComplete to force calling an 'error procedure' when there is error logged instead stopping / continuing the test?
I added EventHandler 'OnLogError':
'CommonScripts unit contains Subs and Functions used by other units, including MailErr and KillThemAll Sub
'Take a screen shot of the active window.
'Send Keys seems to fail without a Proper Delay
'Create PictureObject from Clipboard
Set PicObj = Sys.Clipboard
'Send Email about error with prontscreen attached
Call MailErr(LogParams.AdditionalText, "GAME OVER - " & LogParams.MessageText)
'Kill all trash processes that might remain after error was logged