Automaton testing using Cucumber – Behavior driven development (BDD)

Automation testing using Cucumber – Behavior driven development (BDD)

Application behavior is the main focus on BDD. The requirements are written in English which gives more readability and understandability of the requirement.

So any roles in the company like Tester, developer, end user, and techno functional person can read it and understand it. Also this will reduce the complication in terms of missing requirement or misrepresenting or misunderstanding requirements between different roles like Developer , tester ,  end user etc.

Gherkin is a business readable language, refer below for an example. Below feature file is integrated with Selenium and are having user stories as below.

Please refer below – “feature, Scenario, Given, When, And, Then “are the Keywords below to understand on how to write a feature file…

What is Feature file in Cucumber test and how to create a feature file.

Feature file is a part of Cucumber framework and it contains descriptions in English language.

Follow below path to create a feature file

create feature file

One sample transaction as below:

sample feature fileOne sample transaction example as below:

sample feature file transaction
sample feature file transaction

sample feature file

Web server vs application server

Web server vs application server

Web server

 A Web server can process HTTP requests and respond with HTML pages, provided the requests are handled by server side programs

It uses HTTP protocol to transmit the request/responses. Here Web server handled both request/response and business logic. This is more rigid design.

A web transaction using web server will be like this as below,

Browser (click operation to display some results on a grid> ==> Request goes to web server (Apache HTTP server) ==> Database

Application server

An Application server controls the business logic. Separating business logic from web server and adding to application server will give more reusability for this logic across different applications. This is more flexible design.

A web transaction using app server will be like this as below,

Browser (click operation to display some results on a grid> ==> Request goes to web server (Apache HTTP server) ==> Application server (Tomcat server) ==> Database

Or

Browser (click operation to display some results on a grid> ==> Request goes to web server (Apache HTTP server) ==> Application server (Tomcat server) ==> Web service ==> Third party Database

 

Please click on below linking for getting quick summary 

Web server vs application server vs database server

Load Balancing

Cucumber BDD – scenario table

Jenkins resetting password

 

Selenium features – what are the main features of selenium.

Selenium features – what are the main features of selenium.

Selenium supports Cross Browser Testing and parallel testing. The Selenium tests can be run on multiple browsers and multiple machines and multiple Operating systems. Selenium offers open source tools and supports test automation for web applications

Supports several scripting languages like Java, Python, C#, and PHP

Reporting are very easy and extensible.

Selenium uses Browser native commands. It locates and actions applied on UI elements

TestNG quick summary:

 TestNG’s is Selenium + reporting features. It is easy to generate reports using Listeners and Reporters in TestNG

 Features of TestNG includes the following,

1)      Annotations – please refer my annotation blogAnnotation – TestNG’s test case priority

2)      Supports parameterization/ data driven testing

3)      Test cases can be grouped and parallel testing is allowed.

Automaton testing using Cucumber – Behavior driven development (BDD)

Application behavior is the main focus on BDD. The requirements are written in English which gives more readability and understandability of the requirement.

So any roles in the company (Tester, developer, end user, and techno functional person) can read it and understand it. Also this will reduce the complication in terms of missing requirement or misrepresenting or misunderstanding requirements between different roles (Developer /tester / end user)

Gherkin is a business readable language – refer below for an example. Below feature file is integrated with Selenium and are having user stories as below,

Please refer below – “feature, Scenario, Given, When, And, Then “are the Keywords below to understand on how to write a feature file.

What is TestRunner in Cucumber

In order to link Cucumber with Selenium WebDriver, you need to start a Java project in eclipse IDE.

Then, add both Cucumber and Selenium jar files

Write test runner code and execute the same . Please refer BDD testing details on Selenium Cucumber