Unable to run SpecFlow on VS 2012 - c#

I have just updated from VS 2010 to VS 2012.
I have installed specFlow 1.9 and NuGet package.
I have also installed specflow package through Manage NuGet packages.
Also configure my app.config to Ms test. Added all the required dll's and genereted the feature file as well as my .cs files.
But still im not able to run or Debug my the specFlow Tests.
While the same settinngs worked on VS 2010. And pressing F5 button also does not work.
Is there any Step that I am missing here or any setting that needs to be done prior to running the tests.

I had the same problem. Found this post on the SpecFlow google group. Setting ReSharper as test runner tool made it work for me. I'm running SpecFlow 1.9.3.1 on Visual Studio 2013.
https://groups.google.com/forum/#!msg/specflow/sb38tqgDaq4/pAeprtPu_PcJ

Related

MSTest Not Working on Visual Studio 2019 16.4.0

I'm using MSTest for a test project which was working until I updated Visual Studio 2019 16.2.x to 16.4.0. now when I run all, integration tests that use database not working without any error. But at the build time this message appears as a build result:
but the Test Output Pane is empty.
What should I do??
After searching for the problem, I found that the problem is about .NET Core SDK. Therefore, I reinstalled the dotnet-sdk 2.2.4 and 3.1.100 and tests are working now.

C# Nunit tests from VS 2013 (Nunit v2.x), won't show in Test Explorer in VS 2017 (Nunit 3.x)

Good Morning
Note: I am new to VS and C# coding. Learning and have the following issue.
PROBLEM STATEMENT:
C# Nunit tests from VS 2013 (Nunit v2.x), won't show in Test Explorer in VS 2017 (Nunit 3.x)
BACKGROUND:
Recently identified good scripts for our application written with VS 2013 with C# based on NUnit 2.x.
I have copied them into my machine with VS 2017 and Nunit v.3.10.1 and Nunit3TestAdapter v.3.10.0.
Note: The Tests are running fine in another machine with VS 2013 and Nunit v2.x
Machine and VS config:
- Windows 10 pro 64 bit OS with 64 bit processor
- VS 2017: Default Processor Architecure is set to X64
- At present, "Active Solution Platform" is set to X86 for build settings for my test project (Build > Configuration Manager).
- VS Nuget Package for Nunit: v.3.10.1
- VS Nuget Package for Nunit3TestAdapter: v.3.10.0
What i have done or tried:
- The test project cs file contains [TestFixture] and [Test] in the correct places
- I have tried cleaning / rebuilding the solution multiple times
- I have tried restarting Visual Studio multiple times
- I researched many articles here and in other venues
- Can't get a straight answer yet if it is possible, or impossible or what is the solution.
Thank you very much!
Andrew
Install NUnit3TestAdapter Visual Studio plugin.
In Visual studio, go to Tools -> Extensions and Updates. At the dialog, choose Online from navigation pane, and in the search bar type NUnit, pick the NUnit 3 Test Adapter plugin and install it. Once done, you will be required to restart Visual Studio and rebuild your test project.
With the help of my friend Fahad, the issue seems to be resolved with the following steps:
Unistalled Nunit3TestAdapter v.3.10.0 and Nunit3 v.3.10.0
Manually removed all the "nunit.*" references
Installed the following via NuGet:
Nunit3 v.3.10.1 and Nunit3TestAdapter v.3.10.0
Nunit.ConsoleRunner v.3.8.0
Updated VS 2017 to the version 15.7.3
So at this point I see all the Tests in the Test Explorer. I have another issue with them not running due to this (but possible it is a different issue):
Warnings for not able to run Tests

"Inconclusive: Test not run" error running unit tests in debug mode in Visual Studio / Resharper

I am getting the above error "Inconclusive: Test not run" error when trying to run my unit tests in debug mode in Visual Studio.
I am using Visual Studio 2017 patched with the latest .NET Core 2 release Version 15.3.5 and Resharper Ultimate 2017.1.3
This has only started happening since I installed the latest .NET Core 2.0 patch recently.
This bug has been fixed in R# 2017.2 release build
Another possible answer is to prevent VS from using test settings file. Located in "Test->Test Settings" menu. After changing branches it got enabled somehow without me noticing and tests stopped running. Unchecking it brought my tests back to runnable state.
Test settings file

No Colours in Specflow Feature Files on Visual Studio

I have the latest version of SpecFlow installed, and still the feature files display uncoloured, like so...
(Not enough rep to insert images)
Specflow uncoloured feature files
Is there certain configurations that are set for colours to be displayed in Specflow files?
VS2015
Specflow 2.1
There is an option for coloring syntax in Tools->Options->SpecFlow that could cause the problem.
EDIT:
Ensure your SpecFlow extension is installed correctly:
Go to Tools->Extensions and updates -> Installed look for SpecFlow for Visual Studio 2015. You might try to uninstall and install it again.
If you can't find in the list then select Online, in search type specflow, then select result and install.
Gherkin code highlighting issue on Visual Studio 2019
For Visual studio 2019 need to install an Extension
Extensions -> Manage Extensions -> Search for Specflow
Can see Extension by name 'Specflow for Visual Studio 2019' click and restart the Visual Studio 2019 app.
FIX for VS 2022
If this is still an issue, On update, the extension is removed.
Navigate to Extensions, Click Online, Search Specflow and install the extension.
Restart and modify
Fix is complete
In my case I had the coloring in some projects but in other I haven't. Pre-installing the Visual Studio extension worked for me.

How to publish test results from to TFS from vstest.console.exe

I am using vstest.console.exe to run a suite of integration tests. I am following the instructions here [http://blogs.msdn.com/b/visualstudioalm/archive/2012/12/06/publishing-test-results-through-command-line-test-runner.aspx][1]
Here is my command line (with added newlines for readability):
"E:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe"
/Tests:UserIsAbleToLogIn
"E:\IntegrationTesting\Ads.Slms.IntegrationTesting.Web -Ver_20150206.1\Ads.Slms.IntegrationTesting.Web.Smartfill.dll"
/logger:TfsPublisher;Collection=http://xxxxx:8080/tfs/DefaultCollection;TeamProject=SLMS;BuildName="Ads.Slms.IntegrationTesting.Web -Ver_20150206.1"
However, despite the tool running fine, and reporting that the results have been published, I don't see any results appearing in TFS. I am using TFS2013. I have Visual Studio 2013 Professional installed on the server where my tests are being run.
Is there something I'm missing? Why would vstest report "Publish completed successfully", if I can't see the results in TFS?
Late to the party, but for those who experience the problem in the future, here's what worked for me.
Use the Platform and Flavor in the /Logger argument. Those will tell TFS which built project to associate your test with. By default Platform is 'Any CPU' and Flavor is 'Debug' - in all likelihood your build definition doesn't use that configuration.

Categories