Part-1 | Perform API Testing or Automation of Rest APIs/Web Services using Rest-assured Java Library



Hello Dear Friends,

I hope you are doing Good.!!

Today we are going to see a very interesting article.

And the topic name is ‘Part-1 | Perform API Testing or Automation of Rest APIs/Web Services using Rest-assured Java Library & TestNG’.

Below I am mentioning the Agenda of this topic.

Agenda

1) What is Rest-assured?
2) Why need Rest-Assured?
3) Required Pre-requisites 
4) Steps to setup Rest-assured project
5) Practical demo by using different request types 
  • GET
  • POST
  • PUT
  • DELETE
Will see and discuss each point as mentioned above and to watch on YouTube channel please click on below video.



1) What is Rest-assured?

  • REST Assured is a Java Domain Specific Language API for simplifying testing of RESTful web services. 
  • REST Assured API can be used to invoke REST web services and match response content to test them. 
  • Rest Assured has methods to fetch data from almost every part of the request and response no matter how complex the JSON structures are.
  • REST Assured can be used to test XML as well as JSON based web services. REST Assured can be integrated with JUnit and TestNG frameworks for writing test cases for our application.
  • REST Assured supports POST, GET, PUT, DELETE, OPTIONS, PATCH, and HEAD requests and can be used to validate and verify the response of these requests.

2) Why need Rest-Assured?

  • Using Rest Assured, automation testing of APIs, sending simple https requests with user-friendly customization is simple if one has a basic background of java. 
  • It is needed to understand API testing, and integration testing, but post that automation Rest Assured gives very good confidence on the back-end while front-end testing can just focus on the UI and client-side operations.
  • Rest Assured is a open source with a lot of additional methods and libraries being added has made it a great choice for API automation.
  • One of the powerful features of REST assured is the support of XML Path and JSON Path syntax to check specific elements of the response data. It’s very similar to using XPath API.

3) Required Pre-requisites?

  • Eclipse
  • JAVA
  • TestNG
  • Maven
  • Rest-assured lib 
  • Json-simple lib 
  • Apache POI lib

4) Steps to setup Rest-assured project?

  • First will download Eclipse and will create simple maven project.
  • Then will add TestNG plugin in created project
  • Then will add all below mentioned all required dependencies in pom.xml to fetch the required jars.
  • json-simple
  • rest-assured
  • poi
  • poi-ooxml

Guys remaining part will cover the next article and Part-2 article link is given below,

Link : Part - 2 Link

Comments

Post a Comment

Popular Post

MCQ questions for graphics class method in Java

Session 2 TestNG Framework | How to create TestNG Project In Eclipse IDE | With Selenium Test Cases

Print Hello World In Different Programming Languages | Boost Coding Skill | Developer Life

How to run Selenium script when system is locked?

Read Any Type Of JSON File in JAVA | Simple Introduction And Demo Of JavaScript Object Notation