Ask a Question

How to export the test results to a PDF through script

SOLVED
KP13
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

11 REPLIES 11
Marsha_R
Community Hero

Doesn't look like PDF is an option:

https://support.smartbear.com/testcomplete/docs/reference/project-objects/test-log/log/saveresultsas...


Marsha_R
[Community Hero]
____
[Community Heroes] 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. Posts made by [Community Heroes]
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.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
TanyaYatskovska
SmartBear Alumni (Retired)

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 Yatskovskaya
SmartBear Community and Education Manager



KP13
Occasional Contributor

Thanks .

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

 

KP13
Occasional Contributor

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.

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 Hero]
____
[Community Heroes] 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. Posts made by [Community Heroes]
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.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

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

@TanyaYatskovska 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.

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

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


Marsha_R
[Community Hero]
____
[Community Heroes] 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. Posts made by [Community Heroes]
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.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame

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.

cancel
Showing results for 
Search instead for 
Did you mean: