问题
I want to find a solution to export my test results from test explorer to TFS or any other format like excel. I saw some posts bases on .trx file. In test results folder of my project I have a folder generated each time I run a test with 2 sub folders IN and OUT. The IN folder is always empty and OUT folder contains AgentRestart.dat file. If I run my whole test suite I can only see number of passed and failed tests in Test Explorer. To find out result of each test case and store I need to select on test case one at a time and copy paste to word. I'm looking for a better solution.
I'm using unit test project with MS Test.
Can some one help me with this?
Thanks
回答1:
Currently, there is no way to export test results from VS UI. However, you can use VSTest.Console.exe command-line to achieve it:
vstest.console.exe myTestFile.dll /Logger:trx
If you want to To publish test results to Team Foundation Server, use TfsPublisher:
/logger:TfsPublisher;
Collection=<team project url>;
BuildName=<build name>;
TeamProject=<team project name>;
[;Platform=<Defaults to “Any CPU”>]
[;Flavor=<Defaults to “Debug”>]
[;RunTitle=<title>]
来源:https://stackoverflow.com/questions/37052807/export-test-results-from-test-explorer-visual-studio-2013