Hi Anil,
| I need to post a screenshot in the testlog when an error occurs in the execution of a script? |
Open the project properties and, in the Playback options, select
Post image on error.
| And I also want to know is there any way to export that screenshot (only error images) to an excel sheet? |
You'll need to create an event handler for the
OnLogError event (see
Creating Event Handlers for TestComplete Events). In the event handler body, you can capture the screenshot as Sys.Desktop.Picture, like this:
Sub GeneralEvents_OnLogError(Sender, LogParams)
Dim img
Set img = Sys.Desktop.Picture
' Do something with img
...
End Sub
For sample VBScript code that inserts images into an Excel file, check out the following threads:
http://stackoverflow.com/q/10621537/113116http://www.dbforums.com/asp/978123-how-insert-picture-excel-sheet-using-asp.htmlHope they help you get the idea.