Automation Test Framework
Cucumber – BDD
Presented By:
Dhiraj Kumar Sharma N
Agenda
Objective
ExistingProblem
ProposedSolution
Why this Approach?
Simple Cucumber Test
Cucumber Testing Stack
Framework Architecture
Folder Structure
Cucumber Workflow
Key Feature of Framework
Test Reports
Continuous Integration (CI)
Summary andConclusion
Objective
The Objective of Automation Test Framework with BDD-Cucumber are as follows:
To reduce the gap between software developers andstakeholders
To overcome the disadvantages of other automation tool
To reduce Testing Cost andTime
To improve TestCoverage
To reduceRedundancy
To gain confidence in the system
To reduce the number of defects found by users
To run regression test overnight and weekends
Existing Problem
Producer Gap - Difference between what is specified vs what isdelivered
Customer Gap - Difference between what the producers actually delivered vs what the customer
wanted
Proposed Solution
Cucumber is a software open source tool based on Behavior Driven Development (BDD)
model which is used to write acceptance tests for web application.
Behavior Driver Development is about implementing an application by describing its
behavior from the perspective of its stakeholders
Allows automation of functional validation in easily readable and understandable format (like
plain English) to Stakeholders, Business Analysts, Developers, Testers, etc.
The test suites are then translated into the programming language by Cucumber, which
supports multiple programming and scripting languages.
Continuous Delivery Pipeline is build with Git & Jenkins in order to achieve CICD.
Why this Approach ?
First point and the most important is the price. And, yes! It is free to
use
Behavior driven development which enables- Strong Collaboration,
High Visibility, Ubiquitous Language functional
The stakeholders, Business Owners, Testers and Developers work on the
problem statement to derive the best behavior set
Easy to write and maintain the feature file/Test scripts
Report will be generated in BDD format, so anyone can understand the
report easily
Easy to parameterize testcase and can run feature file parallelly.
Simple Cucumber Test (Feature File)
7
Feature: E-Commerce Application
Scenario: Users should see sign out button once signed in
Given I open the Login page of theapplication
When I enter valid credentials and click sign-in button
Then I verify the application Home Page is displayed
And I verify the sign out button is displayed at bottom of home page
Cucumber uses “Gherkin” Language where Test are written in a file called Feature which contains list of test
scenarios.
Each line in a scenario is called step which are defined with the help of “Given”, “When”, “Then” and “And”
keywords
Step Definition is a place where the automation codes are written for steps in any programming language such
as Java or Ruby
Steps in the feature file are directly mapped to step definitions
Cucumber Testing Stack
Cucumber Framework Architecture
Folder Structure Page Objects Class
Step Definitions ,Hook Class
Runner Class
Helper Libraries
Project Specific Dependency jars
Execution Reports(Html,json,xlxs Reports)
Feature files
Configuration files(Browser Launch,Log4j)
Test Data(xlxs,json Data)
Object Repositories
Test Results(Logs, Failed Test Screenshots)
Browser Drivers .exe files
Maven POM file
TestNG xml Run Configuration file
Cucumber Workflow
Key Feature of Framework
Page Object Model is used as design pattern to capture the object repository for web elements.
Reusable step definitions can be developed and used for any web applications
Extent Report is used to for Report Generation and Log4j is used for Log Generation
Test Reports for TestNG and Cucumber will be placed in target folder
If test scenario fails, the screen for each failed scenario will be taken and placed in Screenshots folder.
Email will be delivered to mail ids with test report with Test Coverage % and Pass %
Integrated with Jenkins, a Continuous Integration Tool which is used to schedule test and separate
cucumber reports will also be generated
Extent Report
Continuous Integration (CI)- Jenkins
Jenkins Automation Report
Summary & Conclusion
Automated Testing with cucumber minimizes the software quality gap and reduces the
communication gap between the developers and stakeholders
The Functional and Unit testing for the web applications has become easy with this framework which
minimizes the human manual effort involved in testing and to overcome the disadvantages of
testing made with other Automation tools
100 % Code Coverage can be achieved through BDD-Cucumber Approach which is Open source Tool
which is also a Automated Acceptance Testing Tool.
DEMO !! QUESTIONS ? THANK YOU

Automation test framework with cucumber – BDD

  • 1.
    Automation Test Framework Cucumber– BDD Presented By: Dhiraj Kumar Sharma N
  • 2.
    Agenda Objective ExistingProblem ProposedSolution Why this Approach? SimpleCucumber Test Cucumber Testing Stack Framework Architecture Folder Structure Cucumber Workflow Key Feature of Framework Test Reports Continuous Integration (CI) Summary andConclusion
  • 3.
    Objective The Objective ofAutomation Test Framework with BDD-Cucumber are as follows: To reduce the gap between software developers andstakeholders To overcome the disadvantages of other automation tool To reduce Testing Cost andTime To improve TestCoverage To reduceRedundancy To gain confidence in the system To reduce the number of defects found by users To run regression test overnight and weekends
  • 4.
    Existing Problem Producer Gap- Difference between what is specified vs what isdelivered Customer Gap - Difference between what the producers actually delivered vs what the customer wanted
  • 5.
    Proposed Solution Cucumber isa software open source tool based on Behavior Driven Development (BDD) model which is used to write acceptance tests for web application. Behavior Driver Development is about implementing an application by describing its behavior from the perspective of its stakeholders Allows automation of functional validation in easily readable and understandable format (like plain English) to Stakeholders, Business Analysts, Developers, Testers, etc. The test suites are then translated into the programming language by Cucumber, which supports multiple programming and scripting languages. Continuous Delivery Pipeline is build with Git & Jenkins in order to achieve CICD.
  • 6.
    Why this Approach? First point and the most important is the price. And, yes! It is free to use Behavior driven development which enables- Strong Collaboration, High Visibility, Ubiquitous Language functional The stakeholders, Business Owners, Testers and Developers work on the problem statement to derive the best behavior set Easy to write and maintain the feature file/Test scripts Report will be generated in BDD format, so anyone can understand the report easily Easy to parameterize testcase and can run feature file parallelly.
  • 7.
    Simple Cucumber Test(Feature File) 7 Feature: E-Commerce Application Scenario: Users should see sign out button once signed in Given I open the Login page of theapplication When I enter valid credentials and click sign-in button Then I verify the application Home Page is displayed And I verify the sign out button is displayed at bottom of home page Cucumber uses “Gherkin” Language where Test are written in a file called Feature which contains list of test scenarios. Each line in a scenario is called step which are defined with the help of “Given”, “When”, “Then” and “And” keywords Step Definition is a place where the automation codes are written for steps in any programming language such as Java or Ruby Steps in the feature file are directly mapped to step definitions
  • 8.
  • 9.
  • 10.
    Folder Structure PageObjects Class Step Definitions ,Hook Class Runner Class Helper Libraries Project Specific Dependency jars Execution Reports(Html,json,xlxs Reports) Feature files Configuration files(Browser Launch,Log4j) Test Data(xlxs,json Data) Object Repositories Test Results(Logs, Failed Test Screenshots) Browser Drivers .exe files Maven POM file TestNG xml Run Configuration file
  • 11.
  • 12.
    Key Feature ofFramework Page Object Model is used as design pattern to capture the object repository for web elements. Reusable step definitions can be developed and used for any web applications Extent Report is used to for Report Generation and Log4j is used for Log Generation Test Reports for TestNG and Cucumber will be placed in target folder If test scenario fails, the screen for each failed scenario will be taken and placed in Screenshots folder. Email will be delivered to mail ids with test report with Test Coverage % and Pass % Integrated with Jenkins, a Continuous Integration Tool which is used to schedule test and separate cucumber reports will also be generated
  • 13.
  • 14.
  • 15.
  • 16.
    Summary & Conclusion AutomatedTesting with cucumber minimizes the software quality gap and reduces the communication gap between the developers and stakeholders The Functional and Unit testing for the web applications has become easy with this framework which minimizes the human manual effort involved in testing and to overcome the disadvantages of testing made with other Automation tools 100 % Code Coverage can be achieved through BDD-Cucumber Approach which is Open source Tool which is also a Automated Acceptance Testing Tool.
  • 17.
    DEMO !! QUESTIONS? THANK YOU