cancel
Showing results for 
Search instead for 
Did you mean: 

How to export the test results to a PDF through script

SOLVED
Occasional Contributor

How to export the test results to a PDF through script

 Hi,

 

Can anyone please guide me  with a sample script to export the test result to a PDF file in TestComplete. I know the manual process to do so, suggested in https://support.smartbear.com/testcomplete/docs/testing-with/log/working-with/exporting/to-pdf.html, but I want to do that through scripting.

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Occasional Contributor

Re: How to export the test results to a PDF through script

Hi  

Thanks for your suggestion.

While exporting the logs to a PDF file manually, it's looking nice to me. I was looking for a single file. But as it is not possible to get PDF through scripting, I will export the test logs to a .MHT file.

View solution in original post

11 REPLIES 11
Community Hero

Re: How to export the test results to a PDF through script

Community Manager

Re: How to export the test results to a PDF through script

Hi @KP13,

 

I agree with Marsha, at the moment, there is no built-in feature to export a PDF file from script. Only manual exporting is possible. Are there any specific requirements for exporting to PDF? TestComplete provides an easy export of test logs to an MHT file. In this case, all information will be stored in one file and it's easy to share it.

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
Occasional Contributor

Re: How to export the test results to a PDF through script

Thanks .

Yes. Currently, we are using the similar type of Python script to save the TestComplete report as a html file.

 

Occasional Contributor

Re: How to export the test results to a PDF through script

Hi  

Thanks for your suggestion.

While exporting the logs to a PDF file manually, it's looking nice to me. I was looking for a single file. But as it is not possible to get PDF through scripting, I will export the test logs to a .MHT file.

View solution in original post

Community Hero

Re: How to export the test results to a PDF through script

Hi,

 

If export to .mht works for you then it's nice. Note, that .mht file can be opened in IE browser only, but not in Chrome and Firefox.

 

If you still like to have .pdf...

As an idea: You may

-- export log to .mht or a set of .html files, then

-- start separate instance of IE (through the COM to make IE not displayed on the screen, though this is optional), then

-- open exported log in IE and

-- print to .pdf via code.

-- Use generated .pdf and do cleanup for the exported log and IE instance.

 

Note: I do not expect that this printed .pdf will be of significant help because of absent screenshots, missed contents of the Additional Info log pane, etc.

 

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Highlighted
Contributor

Re: How to export the test results to a PDF through script

good idea though @AlexKaras , even if it might not be very practical.

Contributor

Re: How to export the test results to a PDF through script

@TanyaGorbunova isn't there an open feature request for test log export to pdf?

 

i know that a lot of folks are interested in the ability to export test logs to pdf from code, and i think i remember seeing this requested in the past but cannot find the feature request list.

Community Hero

Re: How to export the test results to a PDF through script

@dbattaglia Feature requests is the last forum on the main page here:

https://community.smartbear.com/t5/TestComplete/ct-p/TestComplete_forum

Contributor

Re: How to export the test results to a PDF through script

hah!

thanks for pointing that out @Marsha_R 

looks like i voted for 

@mgroen2 on this one a long time ago, in a galaxy far, far away...

https://community.smartbear.com/t5/TestComplete-Feature-Requests/Implement-a-way-of-storing-exportin...

 

and there is this one that also is asking for pdf export

https://community.smartbear.com/t5/TestComplete-Feature-Requests/simple-entire-test-result-printing-...

 

sorry, i guess i did not look hard enough.

anyhow, pdf export would be super helpful.