Export Logs as XML or JSON format
Dear all,
I am trying to accomplish the following: in a TFS build definition, I want to execute TC tests using the Run Functional Tests task on a remote (distributed) test agent and afterwards parse the log output to further process that data (especially the data about every single test-item of the suite). Background is, that the test results published by TC do not include all single test items from TC suites and projects, but only one entry for each test project in the suite. And only if you open up the entry for the test project in TFS, you will see the attached .mht file, which then contains all information about all test items of that project.
I actually thought that I can use the /exportToXmlAlso flag for running TC, but this does not produce an XML at all.
No matter if I start TC using the command line and provide that parameter or if I run TC using the MSBuild task, it somehow just gets ignored. Also for the TFS "Run functional Tests" task, I do not know how to supply that parameter. I also tried to add an event handler for the OnTestStop event for the general events and use the Log.SaveResultAs() method to write a proper XML file, but that did not work either, as I only can write for the current test item and not for all the test items in a suite.
My used documentation so far:
- For publishing test results (which happens automatically when using "Run Functional Tests" task in vNext): https://support.smartbear.com/testcomplete/docs/working-with/integration/ms-vs/alm/team-builds/definitions/vnext.html#publish
- For viewing results and seeing the .mht file attached: https://support.smartbear.com/testcomplete/docs/working-with/integration/ms-vs/alm/team-builds/running.html#Results
- For the MS Build task: https://support.smartbear.com/testcomplete/docs/working-with/integration/ms-vs/msbuild.html
- For the CMD line: https://support.smartbear.com/testcomplete/docs/working-with/automating/command-line-and-exit-codes/command-line.html
- For the Log.SaveResultAs: http://support.smartbear.com/testcomplete/docs/reference/project-objects/test-log/log/saveresultsas.html
Actually I would expect TC to export the logs in the formats as specified here:
All I get so far is the some weird TC internal formats (when using the .tcLogX extension for the log file) or a .MHT file (when using the .mht extension for the log file) and the RootLogData.dat file in the Log folder of the TC suite, which just contains a weird XML structure, having <Node> elements nested allover and which does not seem to be really "parsable".
How can I instruct TC from TC/MSBuild/TFS-Task to export the logs in a nice XML or JSON format?
Any help regarding this topic is very much welcome!!!