Specflow vs Selenium

What are the pros and cons of Specflow vs Selenium?

I'm evaluating Specflow vs Selenium. Our project involves development/test efforts leading to a Web application (.net) that interacts with a windows application (Windows Service) to ultimately communicate with a field-deployed device (such as a handheld vending machine, traffic camera and similar transportation/fleet devices). 

We would like to have a suite of nUnit test code bases, most preferably integrated with a UI-enabled test tool. 

55 Answers

author avatar

Hello fellow members of this community,

Thanks so much for your suggestions. I hadn't proceeded with my automation plans since the posting of this question but now I am having to make a decision and accordingly coming back to the enquiry only now. It is interesting to note that there appear to be two schools of thought a) Use Selenium and b) Use Spec-flow with the a) line of suggestion stemming primarily from lack of exposure to Specflow possibly because its use is still not widespread. We do have a requirement to maintain reusable framework suitable for repeated regression testing. The idea is to integrate the framework to our agile-delivered incremental builds of the windows application so that sanity test scenarios will be automatically run during installation of every new version. So I may just go with SpecFlow.

Ian, just to clarify why we are not comparing apples to oranges, pls note that the journey that we envisage for the tool to make is to execute unit test codebase before and as part of navigating across different pages/features of the application driven purely by a record and playback-based actions. Both Specflow and Selenium seem capable of doing that as a nUnit developed codebase could be invoked from the test tool UI.

author avatar

Specflow and Selenium are really targeted at different requirements so difficult to make a meaningful comparison. (Sort of like comparing a car and a boat.)

· Nunit - make sure the code does what it should.

· SpecFlow - make sure that the individual user requirements (features) are met.

· Selenium - make sure that the user journey is correct.

author avatar
Top 5LeaderboardConsultant


SpecFlow is a .NET based testing tool and follows the BDD methodology from
the start, as it employs Cucumber to create and deliver results. As you
have mentioned that you are going to test on an application built on .NET,
this would suit your purposes nicely, as the developers themselves will
also know how to handle and work on any issues with the tests and can
incorporate them into their Unit tests also.

Selenium is a robust and stable framework for creating tests and can be
overlaid with Cucumber along with other xUnit test frameworks to provide
you with the same set of functionality and features. The only difference
here is that SpecFlow already contains the required features and

Overall, if you wish to ease work and also have a maintainable framework
for future use, I would recommend you to SpecFlow with Cucumber over
Selenium with Cucumber. They have a good site with all the required forums
and FAQs and a sensible community for feedback and solutions.

Selenium is a good framework, and if you have prior experience with it then
it makes better sense to use it, but if not, pick up SpecFlow for your .NET
application testing.

UI with Web and App tests can all be easily created and integrated within
the SpecFlow tests.


author avatar

I haven't used Specflow so cannot compare it with Selenium.

Selenium is good for testing web applications i.e. applications accessed
via web browser. And for writing unit test cases, I would say use TestNg as
it has some more advance features than JUnit e.g. concept of data provider.

Essentially, use the TestNg framework to write both, UI tests (selenium
webdriver) and unit tests.

Hope this helps.

author avatar
Top 20Vendor

Selenium is a very popular scripting language today and what most people are using. That will do what you want. To automate the tests and also repurpose for performance there are tools like Appvance that do this with Selenium.

Find out what your peers are saying about Apache, Micro Focus, SmartBear and others in Performance Testing Tools. Updated: June 2021.
509,570 professionals have used our research since 2012.