MSTest 导出报告

you can use TRXER tool to generate HTML reports from trx file. Download TrxerConsole.exe file from here

  1. Build/Rebuild the project to create .dll file.
  2. If your project name is UnitTest1 then the .dll file name will be UnitTest1.dll. Go to the location of .dll like

C:\Users\NAME\source\repos\UnitTest1 \UnitTest1 \bin\Debug\netcoreapp3.1\UnitTest1.dll

  1. Open Developer command prompt of Visual studio 2019
  2. Run command to set the location

cd C:\Users\NAME\source\repos\UnitTest1\UnitTest1\bin\Debug\netcoreapp3.1\UnitTest1.dll

  1. Run the Command to Generate trx file:

vstest.console.exe UnitTest1.dll /logger:trx

  1. Trx file will be generated in the folder TestReults which is present in the same location where project dll file is present.

  2. If TrxerConsole.exe is in downloads then run the command to convert into HTML.

    Path of trxerconsole.exe file then space then Path of trxfile as below

C:\Users\NAME\Downloads\TrxerConsole.exe C:\Users\NAME\source\repos\DesktopWithMSTest\DesktopWithMSTest\bin\Debug\netcoreapp3.1\TestResults\TestResult.trx

  1. HTML file will be generated in same TestResults Folder.

link to refer

your Reports will look like:

Reports

posted on 2024-02-04 13:12  马什么梅  阅读(24)  评论(0编辑  收藏  举报

导航