How to post a screenshot in the test log when an error occurs in the execution of a script?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2012
10:46 PM
07-18-2012
10:46 PM
How to post a screenshot in the test log when an error occurs in the execution of a script?
Hi All,
Iam using TestComplete v7.52. I need to post a screenshot in the testlog when an error occurs in the execution of a script? And I also want to know is there any way to export that screenshot (only error images) to an excel sheet? I use VBScript language for my scripts. Looking for a great help.
Thanks,
Anil.
Iam using TestComplete v7.52. I need to post a screenshot in the testlog when an error occurs in the execution of a script? And I also want to know is there any way to export that screenshot (only error images) to an excel sheet? I use VBScript language for my scripts. Looking for a great help.
Thanks,
Anil.
AnilCharan
2 REPLIES 2
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2012
12:33 AM
07-20-2012
12:33 AM
Hi Anil,
For sample VBScript code that inserts images into an Excel file, check out the following threads:
http://stackoverflow.com/q/10621537/113116
http://www.dbforums.com/asp/978123-how-insert-picture-excel-sheet-using-asp.html
Hope they help you get the idea.
Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Open the project properties and, in the Playback options, select Post image on error.
I need to post a screenshot in the testlog when an error occurs in the execution of a script?
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:
And I also want to know is there any way to export that screenshot (only error images) to an excel sheet?
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/113116
http://www.dbforums.com/asp/978123-how-insert-picture-excel-sheet-using-asp.html
Hope they help you get the idea.
Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2012
06:17 PM
07-22-2012
06:17 PM
Hi Helen,
Thanks for your reply.
I have selected "Post image on error" in the Project Properties earlier itself.
I will create the Event Handlers and check for my script. Thanks again for your support.
Regards,
Anil.
Thanks for your reply.
I have selected "Post image on error" in the Project Properties earlier itself.
I will create the Event Handlers and check for my script. Thanks again for your support.
Regards,
Anil.
AnilCharan
