I have searched on this topic, didn't find any good info to do it step by step, so I studied it and shared it here. Here is an easy solution.
相关问题
- Illegal to have multiple roots (start tag in epilo
- Newtonsoft DeserializeXNode expands internal array
- how to use special characters like '<'
- XML - XSLT - document() function inside count() fu
- convert logback.xml to log4j.properties
相关文章
- Creating XML Elements without namespace declaratio
- Get Attribute Value From Simple XML Using JQuery /
- Directly signing an Office Word document using XML
- When sending XML to JMS should I use TextMessage o
- Fragment Content Overlaps Toolbar and Bottom Navig
- Getting “Error: Missing Constraints in ConstraintL
- xslt localization
- Upgrading transaction.commit_manually() to Django
Find the vstst.xsd file in your VisualStudio installation, use xsd.exe to generate a .cs file:
xsd.exe /classes vstst.xsd
The resulted vstst.cs file contains all classes defining every fields/elements in a trx file.
you can use this link to learn some fields in a trx file: http://blogs.msdn.com/b/dhopton/archive/2008/06/12/helpful-internals-of-trx-and-vsmdi-files.aspx
you can also use an existing trx file generated from a mstest run to learn the field.
with the vstst.cs and your knowledge of trx file, you can write code like following to generate a trx file.
note that you may get InvalidOperationException due to some inheritance issues on "Items" fields, like GenericTestType and PlainTextManualTestType (both derived from BaseTestType). There should be a solution by googling. Basically put all "Items" definition into BaseTestType. Here is the link: Serialization of TestRunType throwing an exception
to make the trx file be able to open in VS, there are some fields you need to put in, including TestLists, TestEntries, TestDefinitions and results. You need to link up some of the guids. By looking into an existing trx file, it's not hard to find out.
Good luck!