Skip to content

GakhareShubham/api-automation-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Automation Tutorial

In this tutorial you are going to learn How to Automate the API Tests using RESTAssured Library

This project contains automated API tests explained step by step. The tech stack used for this project 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.

  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
  1. Test-1: Optimized way to send the Request and receive the Response
  1. Test-1: Creating the POST Request and validating the Response Code
  1. Test-1: Creating the POST Request and validating the RequestBody & ResponseBody
  1. Test-1 Creating a Pet using POST method and verifying it by using GET method

About

Learn how to automate REST API's in Java using RESTAssured library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%