Forum Discussion
Are you coupling the /ExportToXMLAlso command line parameter with the /ExportLog: command line? They have to work together. You can't have the first without the second.
Hey Robert
Thanks for your reply.
In fact, I am using the following PS1 script to start the process:
Start-Process TestComplete -ArgumentList "$project /run /exportLog:$log /exportLogToXMLAlso /errorLog:$errorLog /Exit /ns" -Wait
However, even if I start it from an ordinary command prompt, no XML results are produced. I only get the RootLogData.dat file generated, which is XML, but not really structured nor according to the documentation. It is pretty hard to parse, as there is only a Nodes/Node collection in there.
So, the following things tried and no XML results showing up:
* PS1 scripts
* CMD (batch) scripts
* TFS run functional tests with additional arguments in .runsettings file
Only thing working so far: right-clicking the logs in TC itself and clicking on "Export to ..." + then selecting the XML option with unpacked format etc.
BTW: am using version 12.31.1833.7
Thanks again for any advice/help with that topic!
- hkoestin7 years agoOccasional Contributor
I would also be very happy with an ordinary JSON file. Doesn't really matter actually, if it is XML or JSON. Just parsable and in the format as given by the documentation.
- tristaanogre7 years agoEsteemed Contributor
What are you passing in on your $log parameter? Have you tried giving the file name a ".xml" extension?
- hkoestin7 years agoOccasional Contributor
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 ... :-(
- tristaanogre7 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
Related Content
Recent Discussions
- 22 minutes agoSubhraDas
- 20 hours agotramuntana