specflow generate step definitions missing from context menu

Try to install SpecRun.SpecFlow from the Nuget Packages, after installation completes you'll get the "Generate Step Definitions" on the context menu.

It worked for me.


Assuming you are bringing up the correct context menu by right clicking in the .feature file as opposed to anywhere else then you may find that the issue is actually caused by the TechTalk.SpecFlow.dll not being referenced in your project.

To add the reference manually (NuGet didn't do it for me) right-click on the References folder of your project and find the TechTalk.SpecFlow.dll which will likely be in '[project]/packages/SpecFlow.X.X.X/lib/netXX/' (X's are version numbers).

Here is the context menu when I don't have the correct reference in place:

enter image description here

And here it is once I do:

enter image description here

This was SpecFlow.2.1.0 and VS2010 which led me to another issue with incompatible .Net versions so I ended up using SpecFlow.1.9.0.


I had the same problem. I was looking for this option in contextual menu of the feature file, but this option exists in the contextual menu of the content of the feature file. So, try open the feature file (*.feature) in the Visual Studio text editor and click right button of the mouse inside text editor. Example of the file:

Scenario: Add two numbers
    Given I have entered 50 into the calculator
    And I have entered 70 into the calculator
    When I press add
    Then the result should be 120 on the screen

Install specflow from Extensions and updates and then restart the visual studio, clean and rebuild the solution

Tags:

Specflow