1
votes

I am getting errors when running specflow html report. I have created a specflow project with NUNit, So i have created my Nunit XMl report that i want to convert in to Html report. When i run in command prompt, i am getting error. Please let me know the mistake i am making.

I ran nunit3-console.exe --labels=All --out=TestResult.txt "--result=TestResult.xml;format=nunit2" "C:\Users\senthil\Documents\Visual Studio 2015\Projects\UnitTestProject12\Test123\bin\Debug\test123.dll"

then i ran specflow.exe nunitexecutionreport Test123.csproj /out:MyResult.html which is throwing errors

Specflow report error

1
SpecFlow 1.9 is very old (4,5 years) and uses an same old MSBuild version. Probably this can not handle your csproj. Could you try it with the latest version of SpecFlow (2.1 or 2.2.0-preview20161020)? - Andreas Willich
Thanks Andreas, I could not find 21. or 2.2.0 from github.com/techtalk/SpecFlow/downloads. can you guide me where can i download the specflow.exe console? - Senthil Kumar
You have to add the NuGet package to your project. nuget.org/packages/SpecFlow/2.1.0 - Andreas Willich
Then you find it in the packages/SpecFlow-2.1.0/tools folder - Andreas Willich
Thanks Andreas, I have 2.1.0 in VS2015 IDE however how to convert my Nunit TestResult.xml to Specflow HTML report. I am actually looking for stepdefenition report. Please assist me, Thanks Again. - Senthil Kumar

1 Answers

0
votes

First, if you are using SpecFlow I would stay on NUnit 2.6.4 instead of going up to NUnit3, the below steps are using SpecFlow 2.1.0 and NUnit 2.6.4 in "C:\NUnit-2.6.4"

If you want the SpecFlow Test Execution Report (STER) in html:

`nunit-console C:\SourceProject\TestProject.dll /out=C:\SpecFlowReport\TestResult.txt /labels`

`specflow nunitexecutionreport C:\SourceProject\TestProject.csproj /xmlTestResult:C:\NUnit-2.6.4\bin\TestResult.xml /testOutput:C:\SpecFlowReport\TestResult.txt /out:C:\SpecFlowReport\SpecFlow_TestExecutionReport.html`

If you want the SpecFlow Step Definition Report:

`specflow stepdefinitionreport C:\SourceProject\TestProject.csproj /out:C:\SpecFlowReport\SpecFlow_StepDefinitionReport.html`

Pickles is also a good and easy way to get a useful view of your tests for team members that maybe do not want to look directly at the code and it also indicates the Pass/Fail status to match the STER of the same test run

Add NuGet "Pickles.CommandLine" 2.16.2 and execute the below from within the resulting package directory to generate the Pickles report files:

`pickles --feature-directory=C:\SourceProject\Features --output-directory=C:\SpecFlowReport\PicklesFeatureReport --link-results-file=C:\NUnit-2.6.4\bin\TestResult.xml  --documentation-format=dhtml  --enableComments=true

`