KEMBAR78
API Automation Testing Using RestAssured+Cucumber | PPTX
API Automation Testing
using
RestAssured+Cucumber
Presented By:
Mukesh Kumar (QA Consultant)
Alok Jha (QA Consultant)
Agenda
● Why API automation testing
● Need of API automation testing using BDD
● Ingredients(Rest assured, TestNG, Cucumber, maven and Java)
● Demo
Why API automation testing
● GUI independent :
Access to application without UI, helps tester to recognise
the errors early instead of it become large issue in GUI
testing.
● Test core functionality :
API testing requires lots of conditions and inputs which
expose small errors and evaluate build strength.
Why API automation testing
● Cost effective :
○ Execution of API testing is faster than GUI testing thus gives
faster result and hence cost effective.
○ Testing the API level functionality provides early evaluation
of overall build strength before going to GUI testing
○ Requires less code than GUI testing.
Why API automation testing
● Time effective :
API testing is far more time effective then functional and
validation testing.
● Technology independent :
API testing uses either JSON or XML for data exchange and
HTTP request and response.
Need of API automation testing using BDD
● It allows users to define application operations in plain text.
● Gherkin’s simple but powerful syntax lets developers and testers write complex tests
while keeping it comprehensive to even non-technical users.
● Tests automated with cucumber are generally focused on user interactions with the
system.
● If you are writing a microservice, you might describe your contracts and acceptance
criteria using cucumber so that you can use the acceptance test as “living
documentation” that both describes what the service does and proves that it works.
Ingredients
● Rest assured : Rest-Assured is a Java based DSL (Domain Specific Language) which
supports multiple HTTP request.
● TestNG : TestNG is an automation framework. It is inspired by JUnit but designed to be better
than JUnit, eliminating limitations of the older framework.
● Cucumber : Cucumber is a tool based on BDD methodology. The main aim of BDD
framework is to make various project role like business analyst understand the application
without diving deep into the technical aspects.
Rest Assured
● RestAssured is a Java library that provides a DSL for writing powerful, maintainable
tests for RestFul APIs.
● Rest Assured can be used along with JUnit or TestNG testing framework to enhance
test case maintainability and reporting.
● RestAssured is free to use and there is no explicit licence required to use.
● RestAssured can be used as a Maven dependency.
● It supports scala and groovy thus it can be used by various developer/QA who knows
these languages.
TestNG
● TestNG is a testing framework inspired from JUnit and NUnit but introducing some new
functionality.
● TestNG gives the ability to produce HTML Reports of execution.
● Test cases can be Grouped & Prioritize more easily.
● Parallel testing and Data parameterization is possible.
● Provides various annotations. {@BeforeSuite, @AfterSuite, @BeforeTest, @AfterTest,
@BeforeGroups, @AfterGroups, @BeforeClass, @AfterClass, @BeforeMethod,
@AfterMethod, @test}
Cucumber
● Cucumber is a testing tool that supports Behaviour Driven Development
(BDD) framework.
● Cucumber allows automation functional validation that is easily read and understood.
● Cucumber was initially implemented in Ruby and then extended to Java framework.
● Cucumber isn’t suitable for RSpec, unit testing and so on. Basically it is a low
dimension testing/determination system.
● It enables groups to discuss prerequisites with more accuracy, find absconds early and
deliver programming that remains part viable after some time.
Project Structure
References:
● https://cucumber.io/
● http://rest-assured.io/
Thank You
:)

API Automation Testing Using RestAssured+Cucumber

  • 1.
    API Automation Testing using RestAssured+Cucumber PresentedBy: Mukesh Kumar (QA Consultant) Alok Jha (QA Consultant)
  • 2.
    Agenda ● Why APIautomation testing ● Need of API automation testing using BDD ● Ingredients(Rest assured, TestNG, Cucumber, maven and Java) ● Demo
  • 3.
    Why API automationtesting ● GUI independent : Access to application without UI, helps tester to recognise the errors early instead of it become large issue in GUI testing. ● Test core functionality : API testing requires lots of conditions and inputs which expose small errors and evaluate build strength.
  • 4.
    Why API automationtesting ● Cost effective : ○ Execution of API testing is faster than GUI testing thus gives faster result and hence cost effective. ○ Testing the API level functionality provides early evaluation of overall build strength before going to GUI testing ○ Requires less code than GUI testing.
  • 5.
    Why API automationtesting ● Time effective : API testing is far more time effective then functional and validation testing. ● Technology independent : API testing uses either JSON or XML for data exchange and HTTP request and response.
  • 6.
    Need of APIautomation testing using BDD ● It allows users to define application operations in plain text. ● Gherkin’s simple but powerful syntax lets developers and testers write complex tests while keeping it comprehensive to even non-technical users. ● Tests automated with cucumber are generally focused on user interactions with the system. ● If you are writing a microservice, you might describe your contracts and acceptance criteria using cucumber so that you can use the acceptance test as “living documentation” that both describes what the service does and proves that it works.
  • 7.
    Ingredients ● Rest assured: Rest-Assured is a Java based DSL (Domain Specific Language) which supports multiple HTTP request. ● TestNG : TestNG is an automation framework. It is inspired by JUnit but designed to be better than JUnit, eliminating limitations of the older framework. ● Cucumber : Cucumber is a tool based on BDD methodology. The main aim of BDD framework is to make various project role like business analyst understand the application without diving deep into the technical aspects.
  • 8.
    Rest Assured ● RestAssuredis a Java library that provides a DSL for writing powerful, maintainable tests for RestFul APIs. ● Rest Assured can be used along with JUnit or TestNG testing framework to enhance test case maintainability and reporting. ● RestAssured is free to use and there is no explicit licence required to use. ● RestAssured can be used as a Maven dependency. ● It supports scala and groovy thus it can be used by various developer/QA who knows these languages.
  • 9.
    TestNG ● TestNG isa testing framework inspired from JUnit and NUnit but introducing some new functionality. ● TestNG gives the ability to produce HTML Reports of execution. ● Test cases can be Grouped & Prioritize more easily. ● Parallel testing and Data parameterization is possible. ● Provides various annotations. {@BeforeSuite, @AfterSuite, @BeforeTest, @AfterTest, @BeforeGroups, @AfterGroups, @BeforeClass, @AfterClass, @BeforeMethod, @AfterMethod, @test}
  • 10.
    Cucumber ● Cucumber isa testing tool that supports Behaviour Driven Development (BDD) framework. ● Cucumber allows automation functional validation that is easily read and understood. ● Cucumber was initially implemented in Ruby and then extended to Java framework. ● Cucumber isn’t suitable for RSpec, unit testing and so on. Basically it is a low dimension testing/determination system. ● It enables groups to discuss prerequisites with more accuracy, find absconds early and deliver programming that remains part viable after some time.
  • 11.
  • 12.
  • 13.

Editor's Notes

  • #7 jhghjghjghjgjhghjg