cancel
Showing results for 
Search instead for 
Did you mean: 

How to take a screen shot for a failed step??

pavanmac
Contributor

How to take a screen shot for a failed step??

Hi, 

Can you me suggest how to -

1. Take a screen shot for a failed step(Testcomplete using python)? 

 

2. If an error occurs and is displayed in "Script Test Log" and the failed step is in red color how to take screen shot of the log? 

 

3. Also how to Update the HTML result to excel sheet?? 

 

Please suggest the solutions for the above. !

3 REPLIES 3
baxatob
Community Hero

Re: How to make a screenshot

I moved your topic here, because it touches new questions. 

 

Just kindly ask you to rename the subject.

pavanmac
Contributor

Re: How to make a screenshot

Hi , 

 

I have edited the subject as per your suggestion. 

 

Let me know about the solution!!

 

baxatob
Community Hero

Re: How to take a screen shot for a failed step??

1. You can use the following code for taking a screenshot:

 

def take_screenshot(path):
    Sys.Desktop.Picture().SaveToFile(path)

''' 
path should be a string with full path to your destination,
e.g.
"C:\\Users\\User\\Desktop\\shot.jpg"
Sys.Desktop will provide a screenshot from the whole desktop.
You can use any mapped object instead of
Sys.Desktop
'''

2. Enable Post image on error option in your Project -> Properties -> Playback -> Log

 

3. Currently TestComplete does not have an option to export log to Excel format, however you can create a feature request.

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors