Ask a Question

Programatically export test run results to HTML using COM

jrussell
Occasional Contributor

Programatically export test run results to HTML using COM

I am able to run a Project Test Item from a COM (C#) application.  The challenge I have is getting the results from the Project Test Item.  I am able to receive the status of the run(OK, Warning, Error), but I would like to get access to the logs from the run.  I would like to display these results in HTML format.

 

I would like to programmatically export the latest test results to HTML.  I know how to do it via TestComplete UI, but I would like to do this via COM interface.

 

17 REPLIES 17
rraghvani
Champion Level 3

Is this relating to TestComplete MSTest or TCUnitTest unit tests?

jrussell
Occasional Contributor

This is related to TestComplete

jrussell
Occasional Contributor

This relates to running TestComplete Script Unit tests and Test Project Items.

Henry1
Contributor

You can get the name of the log by calling

 

IntegrationObject.GetLastResultDescription().LogFileName

 

It will always point to a xml file called RootLogData.dat

 

Parse this xml and look for the Prp tag with the attribute name="filename". In the attribute value you will find the name of the log file. Something like this: ="{D7603EDA-C8B8-4006-9D57-F034297D444A}"

 

This log file is a xml file as well. Now parse this xml and write your desired html code. Every Node tag represents a message line.

 

 

rraghvani
Champion Level 3

Are you using MSTest or TCUnitTest to interact with your application?

rraghvani_0-1695824296089.png

 

If you see TestComplete Command Line, the parameter /ExportLog has option to export to HTML

I don't believe what command line is relevant for calling TestComplete via COM from C#

https://support.smartbear.com/testcomplete/docs/working-with/automating/via-com/index.html

 

jrussell
Occasional Contributor

If we were using the command line, the parameter /ExportLog would work perfectly.  Unfortunately we are not using the command line.  The command line does not give us enough control over the execution of the tests.

jrussell
Occasional Contributor

We are running tests in the Execution Plan section , and the Script section.

rraghvani
Champion Level 3

How are you connecting to your COM application?

cancel
Showing results for 
Search instead for 
Did you mean: