This blog will help you to initiate the API Automation testing with the REST Assured library.
In this blog, we will cover the below topics required.
- What is
REST Assuredin REST API Automation Testing?
- Prerequisites to start REST API Automation Testing.
So Let’s directly jump to our topics.
What is REST Assured?
REST Assured is a Java library by which we can do REST API testing easily.It supports many HTTP methods like GET, POST, PUT, DELETE, etc. It uses the BDD(Business Driven Development) process.
Prerequisites to Start REST API Automation Testing
- REST Assured supports multiple languages and with the help of REST Assured, we can test any application which provides an HTTP response. Out of multiple languages, We have chosen JAVA language to start testing with REST Assured, some basic knowledge and concepts of JAVA are required. Like Object, Class, Method, Conditions, Array, String, etc.
Here is the link for more information about the same.
- As we are doing REST API automation testing so, basic Knowledge of API, HTTP Methods (like GET, POST, etc.), and how we test API manually are required.
Providing some basic details here :
We can access API by endpoint URL.
Syntax of endpoint URL:
Base URL/ Resource / (Query / Path ) Parameters
Base URL represents the server name and IP address where the request should go.
Resource represents which API should point out or should call.
Parameters provide input value to resource and whether parameter will be
Path, it depends on API nature.
Here we used the reqres.in site for reference.
https://reqres.in/ is the base URL.
api/users is the resource.
Here we used query parameter i.e.
This method is used for retrieving the data from the server as per the requested API.
Example: Here for every example, we used the reqres.in site for reference.
This method is used for sending/creating the data to the server.
This method is used for updating the existing data.
This method is used for deleting the data from the server.
This method is for updating the existing data partially instead of the complete data update.
HTTP Status Codes:
Whenever we send a request to the server, the server responds with a response in the status code, which indicates whether a specific HTTP request has been successfully completed or not. For more details on the response status code, please check here.
Last but not least for starting REST API Automation Testing we require some tools.
Tools information and installation process for API automation testing with REST Assured, We will cover in the next blog. So stay tuned.