There are many times when looking over the Test Log after an unsuccessful test it would be useful to know the state of the machine at the time of the error. In particular, it would be nice to see a picture of the desktop (or your application under test) at the time of error being posted to the log. Now, if you are doing the error posting from you script, it is easy as one of the parameters for Log.Error allows for posting a picture. But if, TestComplete posts the error it is harder. The best method I have found is to use the OnLogError event of TestComplete and post a message just before the error with the picture. To do this:
[Jscript]
function GeneralEvents_OnLogError(Sender, LogParams) { Log.Message(LogParams.Str,"",pmNormal,null,Sys.Desktop); }
[VBScript]
Sub GeneralEvents_OnLogError(Sender, LogParams) Call Log.Message(LogParams.Str,"",pmNormal,nothing,Sys.Desktop) End Sub
This will get you a message above the error in the test log with the same text and a picture of the desktop at the time of the error.
Remember Me
a@href@title, i, strike, u
Copyright © 2003-2008 Falafel Software Inc.
Subscribe to Falafel Blogs
The opinions expressed herein are Falafel's employees own personal opinions and do not represent Falafel Software's view in any way in case they go bananas!