Forum Discussion

tbom's avatar
13 years ago

Catching pictures in onLogError event handlers?

Is it possible to catch the screenshot, that TestComplete automaticly creates when an Log.Error() event is created?

The OnLogPicture event handler is never called on the automaticly generated screenshots.

One way could be to always post a new picture using Log.Picture() in the error handler, but then it will generate an extra screenshot to the log file.

What I'm trying to accomplish, is to post the screenshot to a central logging webservice.



1 Reply

  • AlexeyK's avatar
    SmartBear Alumni (Retired)


    The image is generated automatically, because the Post image on error setting is enabled in your project properties. To get only one picture in the log, disable this setting and use Log.Picture within the OnLogError event handler.

    To find the setting, right-click your project in the Project Explorer, choose Edit | Properties from the context menu. This will open the project editor and activate its Properties page. On the page, select the Playback category from the tree on the left. The setting will be on the right, at the bottom.