Skip to content

Instantly share code, notes, and snippets.

@hmandal
Last active August 22, 2017 11:35
Show Gist options
  • Save hmandal/63bd944042645bcba4d2393173481222 to your computer and use it in GitHub Desktop.
Save hmandal/63bd944042645bcba4d2393173481222 to your computer and use it in GitHub Desktop.
Run Specflow from the Command Line and Hacks to make Specflow Working.

Table of Contents

Batch File

if Exist TestResult.trx del TestResult.trx 

"D:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" D:\...\bin\Debug\ProjectSpecs.dll /Logger:trx

D:\...\packages\SpecFlow.2.2.0\tools\specflow.exe mstestexecutionreport D:\...\ProjectSpecs.csproj /testResult:"TestResults\<UserName>_<WorkStationName> <timestamp>.trx" /out:TestResult.html

echo Created file TestResult.html

D:\...\TestResult.html

pause

Generate Feature.cs files

D:\...\packages\SpecFlow.2.2.0\tools\specflow.exe generateAll D:\...\Specs.csproj /force /verbose

Generate Test Execution Report (.Trx) File

"D:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" D:\...\bin\Debug\Specs.dll /Logger:trx

Generatre a HTML Report

D:\...\packages\SpecFlow.2.2.0\tools\specflow.exe mstestexecutionreport ...\Specs.csproj /testResult:"TestResults\<UserName>_<WorkStationName> <timestamp>.trx"

Hacks for SpecFlow

  1. Clear %temp% -> specflow-stepmap-....cache
  2. Clear %temp% -> VisualStudioTestExplorerExtensions Folder
  3. Change to X64 in VS menu Test -> Test Settings -> Default Processor Architecture
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment