(Automate Test) Behavior Driven Development-Specflow #1

Piyathida San-aoun
2 min readNov 9, 2019

In the first time, before we will implement. I would like to explain about Specflow, BDD and Cucumber about meaning and why i am using specflow to implement Automate test. let go to enjoy >>>

What is BDD ?

  • Behavior Driven Testing is an enhancement of TDD.
  • In BDD also we write tests first and than later we add code for the test.
  • Tests are write in plain English type gamma.
  • Every tests represent a behavior of an application

What is Cucumber ?

  • Cucumber is testing framework which support BDD.
  • Cucumber use gamma defined by language called Gherkin
  • Gherkin language provide the keyword such as Given, When, Then, And
  • Using which one can write the test scenario

What is Specflow ?

  • Specflow is the .Net implementation of Cucumber.

Gherkin Keywords

Keyword Gherkin
  • Feature Keyword : Each feature file begins with this keyword. This provide the name and description of the feature which is under test.
  • Scenario Keyword : Each feature will have multiple test. A Test is describer by scenario keyword.
  • Given Keyword : This is keyword defines a precondition of a scenario.
  • And Keyword : This keyword is used to provide the additional condition to the step. It can be used with Given, When and Then
  • When Keyword : This keyword defines an action that will be executed.
  • Then Keyword : This keyword defines the outcome of the previous step.
  • But Keyword : This keyword defines negative condition added to the previous step
  • Background Keyword : This keyword defines the step which are common across the scenario

In next the contents, I will show about how to do Automate by Gherkins or Specflow.

--

--