SpecFlow Runner Installation

The components in SpecFlow+ are distributed as NuGet package. There is a separate package for SpecFlow+ Runner (SpecRun) and SpecFlow+ Excel. Both components require SpecFlow to be installed as well. SpecFlow is also available as a NuGet package of its own, but installing one of the SpecFlow+ packages automatically installs the SpecFlow NuGet package as well.

The installation of SpecFlow and SpecFlow+ Runner is described in detail in the Getting Started guide for SpecFlow. The installation of the SpecFlow components is also covered in the SpecFlow documentation.

Details on installing SpecFlow+ Excel can be found here.

Installation and Setup

Installing SpecFlow consists of two steps:

  1. Install the IDE integration
  2. Set up your Visual Studio project to work with SpecFlow

Installing the IDE Integration Packages

The method used to install the IDE Integration packages depends on your IDE:

  • Visual Studio 2010+ (including Community Edition but not Express Edition): The easiest method is to select Tools | Extensions and Updates from the menu in Visual Studio, switch to the Online search on the left and enter “SpecFlow” in the search field at the top right.
    ExtensionsAndUpdatesDialog
  • Visual Studio Express: Refer to Install IDE Integration for direct download links and information on installing SpecFlow for other IDEs.

Setting Up your SpecFlow Project

Once you have installed the Visual Studio integration, you need to set up your solution to use SpecFlow. SpecFlow tests are usually placed in separate projects in your solution. The quickest way to set up a project is add the NuGet package to your project. For a detailed project setup guide, see the Setup SpecFlow Projects page.

To set up your specification project:

  1. Add "Unit Testing Project" to your solution (e.g. "MyProject.Specs").
    Note: Creating a “Unit Test Project” is the recommended procedure, as it reduces the number of steps required to set up your project.
  2. You can choose to remove the UnitTestX.cs file, as it is not required.
  3. Add SpecFlow+ Runner to your specification project using NuGet:
    1. Right-click on your specification project (e.g. “MyProject.Specs”) and select Manage NuGet Packages for Solution.
    2. Search for “SpecRun” and install SpecRun for SpecFlow 2.0.0.
      Alternatively, you can install the package from NuGet's console (Tools | NuGet Package Manager | Package Manager Console) as follows:
      PM> Install-Package SpecRun.SpecFlow
  4. Installing SpecFlow+ Runner automatically downloads the SpecFlow runtime from NuGet and adds it to your specifications project.

Registering SpecFlow+

Installing the NuGet packages installs SpecFlow and SpecFlow+ to the /packages folder of your Visual Studio solution. After installing the packages, register your license by starting SpecRun.exe (in /packages/SpecRun.Runner.1.x.y/tools) from the command line using the following syntax:

SpecRun.exe register <LicenseKey> "<Licensee>"

(replace the placeholders indicated by angled brackets with your license key and licensee)

Note: If you purchased SpecFlow+ via SWREG, the licensee is the email address you used to make the purchase and that the license key was sent to.