Saturday, 11 April 2015

SpecFlow-Cucumber for .NET & Selenium with C#

Agenda for this Blog: To discuss about SpecFlow which is Cucumber for .Net.

SpecFlow supports the concepts of Acceptance Test Driven Development (ATDD) and Behaviour Driven Development (BDD), which are often used synonymously filling the gap between domain experts and Developers by binding business readable behaviour specifications,it uses  Gherkin.

What is Gherkin:
Gherkin is the language that Cucumber understands. It is a Business Readable, Domain Specific Language that lets you describe software’s behaviour without detailing how that behaviour is implemented.

Gherkin Syntax example:

Feature: To Cover regression of some application
                and its business values
 
        Scenario:   To test the Login Scenario
          Given           User needs to be on the Login Page of the Application
          And               some other precondition
          When           enter text as Username and Password
          And               click on the sign in button
          Then             verification of the login (Such as Home page should be displayed)


Which Unit Test Provider is acceptable :

We can use Unit Test Provider  as per the  need and choice such as we can use NUNit,MsTest or we can use SpecRun along with SpecFlow to run our Test Scripts.


Unit Test Provider can be configured in app.config file in the Unit Test Project like:

<specFlow>
  <unitTestProvider name="SpecRun" />
</specFlow>


We need to create separate feature file and we need to use gherkin syntax there,we can generate the the step definition for the same and we need to incorporate the Selenium C# code for writing Test Script.

Sample for SpecRun Report:







Visit for More Automation Related Discussion:

https://www.youtube.com/channel/UCKSk4gkmO3LXcW17hFUkmcQ/videos

No comments:

Post a Comment