| || |
Capture Error Message and Remarks OnLogError
When an error occurs (and warnings for that matter) I would like to be able to capture the message and/or remarks that are/will be written to the test log. My goal is to:
(A) Include the information in the body of the email sent on test completion so I do not have to open the exported log file(which I am not able to do on mobile devices).
(B) As well as potentially create an event handler for certain types of errors.
I have looked at the Project.Logs, LogResults and LogItem objects but these do not work on the log for the currently running test.
Re: Capture Error Message and Remarks OnLogError
You can handle events to do this (OnLogError to capture errors, OnLogWarning for warnings, etc.). In the corresponding event handler, you can access the currently posted message's text and remarks via the LogParams object (passed to the handler as a parameter).
See the "About Events and Event Handling" and "LogParams Object" help topics for more information.