Git Product home page Git Product logo

api-automation-tutorial's Introduction

API Automation Tutorial

In this tutorial you are going to learn How to Automate the REST API's in Java using RESTAssured Library

The tech stack used for this tutorial are:

  1. JAVA as the programming language for writing test code
  2. TestNg as the framework
  3. Gradle as the build tool
  4. IntelliJ as the preferred IDE for writing java code.

Getting Started

Setup your machine.

  1. Install JDK 1.8
  2. Install IntelliJ (Community edition is fine)
  3. Install Gradle

Cloning & Importing the Project

  1. Clone the project from git clone https://github.com/vinaykumarvvs/api-automation-tutorial.git
  2. Import the project (api-automation-tutorial) in IntelliJ File -> New -> Project from Existing Sources -> Browse Project Location -> build.gradle
  3. Now click on auto import -> Ok wait until the IntelliJ downloads all the dependencies

Running tests

Note: For 2nd & 3rd steps, you need to follow this way OpenTerminal/CMD -> cd <change-to-project-location>

  1. You can run the tests directly from the IntelliJ, by right-clicking and Run test.
  2. For Linux/Mac users: gradle clean build runTests
  3. For Windows users: gradlew clean build runTests

Tutorial Begins

PetStore - Swagger

Throughout this tutorial, I am going to use PetStore-Swagger. PetStore - Swagger is the open source project which has very good documentation with the various number of examples.

Chapter 1 :: Send a GET Request and validate the Response

  1. Test-1: Send a get Request of an API and validate the body
  2. Test-2: Send a get Request of an API by passing the Query Parameters in the URL itself
  3. Test-3: Send a get Request of an API and retrieve the data from the body
  4. Test-4: Send a get Request of an API and store the Response

Chapter 2 :: Abstracting the code

  1. Test-1: Abstracting the Requests for maintenance and readability

Chapter 3 :: POST Request creation and validating the Response Code

  1. Test-1: Creating the POST Request and validating the Response Code

Chapter 4 :: POST Request creation and validating RequestBody & ResponseBody

  1. Test-1: Creating the POST Request and validating the RequestBody & ResponseBody

Chapter 5 :: Chaining the API's

  1. Test-1: Chaining Requests and validate Response Body

api-automation-tutorial's People

Contributors

vinaykumarvvs avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.