Posts

Showing posts from March, 2019

Specflow -Part3(Working with tables using Specflow.Assist.Dynamic)

In the previous lecture, we learned how can we work with tables to handle test data from the feature file.I will paste the feature and step definitions from earlier lecture and then we will talk about the shortcomings and how Specflow.Assist.Dynamic can help us to overcome them Feature File Feature : SpecFlowFeature2 In order to show specflow capabilities for working on tables We are going to write some scenarios here Scenario : Verify specflow can read data from table and print on console Given  I have dummy student data as below   |  StudentId  |  StudentName  |  Division     |  Age  | |  100        |  James        |  Engineering  |  30   | |  101        |  Jon          |  Medical      |  40   | |  102        |  Steve        |  Engineering  |  50   | Then  I print details on console Custom Class public   class   Student     {         public   int   StudentId ;         public   string   StudentName ;         public   string   Division ;         public   int   Age ;

Specflow -Part2(Working with tables)

We may need to work with scenario's where we need to pass a large set of data to test, for example, you are working on Student information management system where you need to create student and enter his/her details into the system. We can pass the data using tables. I have added one more feature file to an existing project which has a scenario which takes student details and then prints the details on console Feature : SpecFlowFeature2 In order to show specflow capabilities for working on tables We are going to write some scenarios here Scenario : Verify specflow can read data from table and print on console Given  I have dummy student data as below   |  StudentId  |  StudentName  |  Division     |  Age  | |  100        |  James        |  Engineering  |  30   | Then  I print details on console Now we will go ahead an add step definitions for the above steps namespace   SpecflowTest {      [ Binding ]      public   class   SpecFlowFeature2Steps      {         

Specflow -Part1(Installation and Introduction)

We have already talked about BDD in our course introduction, it is a specification used for software development Specflow is a testing framework that supports BDD and uses Gherkin language to define application behaviour You can refer to course introduction for more details on BDD, Specflow and Gherkin We will jump into using specflow Installation In visual studio, Go to Tools--> Extensions and updates Select online and in search type specflow Install Specflow for visual studio  We have added the specflow extension for visual studio, let's add the specflow package to our project Create a new solution and add test project called SpecflowTest Right-click the project and select 'Manage Nuget packages' Search for specflow.mstest and install In App.config file of the project, Verify if below tag is present inside specflow tag < unitTestProvider   name = " MsTest "  /> If not, then go ahead add same. Here we a