Forum Discussion
What are you passing in on your $log parameter? Have you tried giving the file name a ".xml" extension?
I am passing a simple file path there: e.g. "C:\TestAgent\log.mht"
The path does not contain any spaces, so I can pass it without being worried about escaping etc.
It does not matter what name the log has, passing log.mht and log.xml both evaluates to a file, which contains MHT content in base-64 encoding.
Really going nuts with this problem ... :-(
- tristaanogre8 years agoEsteemed Contributor
The fact that you are using the "mht" extension is indicating to the application to do the multipart file. Try changing the extension to log.html and see if you get the XML export.
Another option is to add code to your project instead, to be executed at the end of the project. Add a call to Log.SaveToDisk to be sure to flush all the log to disk. Then, use Log.SaveResultsAs (https://support.smartbear.com/testcomplete/docs/reference/project-objects/test-log/log/saveresultsas.html) and be sure to use the lsXML format
- hkoestin8 years agoOccasional Contributor
Changing the extension to .html did not help either.
I already tried the option with the code/scripting: I added a OnTestStop event handler to the project and used SaveResultAs, but that did not help either. I still get the weird XML format and not the one specified here:
To me, this seems to be a bug in the runner of TC. According to all the documentation of the cmd-options, I should be able to just launch TC for test execution (/run parameter) with the /exportLogToXMLAlso flag and should get the XML file with the structure defined in the link above.
Somehow, I just don't get the files I need.
Will need to come up with a robust algorithm for parsing the RootLogData.dat file (which is in XML format) and just consider all the Nodes-Node-Node-Node combinations, using the moniker-element as indication for the tree-structure within the project.
- LouisP6 years agoNew Contributor
Hello, I have the exact same problem, and I was wondering if this problem had been resolved.
Thanks a lot.