Creating HTML Report for Test Execution Result
How to create HTML report with details of test execution
Very often , we will be required to create a report with details of test execution , so that it can be presented to various stakeholders. Specflow provides a feature to create HTML reports. Let us look into more details about how is this done
- Read through and understand details of reporting from specflow.
- Ensure packages for Specflow, Nunit, Nunit console runner are already installed.
- If you are using Nunit 3, install NUnit.Extension.NUnitV2ResultWriter package via nuget package manager. If this is not installed, we will get an error “Unknown result format: nunit2”.
- Follow setups required for running specflow test cases from command line. Details can be found here.
- Modify the bat file to create nunit2 reports.
1
|
|
- Add below command into Bat file. This will create HTML Report called “MyResult.html”
1
|
|
- Final bat file will look like below.
1 2 3 4 5 |
|
EDITED: If it throws below error in newer version of Visual Studio then ensure MS Build tool 2013 is installed. It can be downloaded from https://www.microsoft.com/en-US/download/details.aspx?id=40760
Error : “The tools version "12.0” is unrecognized. Available tools versions are “2.0”, “3.5”, “4.0”. “,