Wednesday, June 5, 2019

Test reporting for MSunit testing

  1. After you have finished your code about test, go build=>rebuild the solution. (no need to use test explorer)
  2. When rebuild succeeds, find the .dll file of your unit test project and copy the path of this file. (In my test, it’s UnitTestProject3.dll)
  3. Open the ‘developer command prompt for VS’. And then type “cd path” command to locate the file which contains the dll file. (The path is what you copy in step2)
  4. After that, type “vstest.console.exe UnitTestProject3.dll /logger:trx”. Then you can see the test result in the window, also you can find the sentence like this “Results file: …path\name.trx”
  5. That is the test result file you want, and you can convert it from xml to HTML by using third-party tools such like trxer. You can type “TrxerConsole.exe TestResultFileName.trx” in cmd to convert it to HTML using trxer.

No comments:

Post a Comment