Skip to content

Make Selenium Easy

And Keep It That Way

  • Home
  • Share
  • Toggle search form

REST Assured Tutorial 1 – Introduction to REST Assured

Posted on 02/19/2025 By admin

As a part of End to End REST Assured Tutorial, in this post, we will see the introduction of Rest Assured.

Demand for API Testing is increasing day by day as it helps in finding bugs early in the Software development life cycle and prevents major bugs at later stages. We can perform API Testing manually and programmatically i.e. Automation.

We have covered Manual API Testing using Postman. Now it’s time to learn about API Testing Automation using a Java library called Rest Assured.

REST-assured is an Open Source Java library that is used to test and validate REST APIs. Dynamic languages like Groovy, Ruby are helpful and simple to perform API testing which was harder in Java. Rest Assured is responsible to bring simplicity to do API Testing using Ruby and Groovy in Java.

REST Assured is a Java DSL for simplifying testing of REST-based services built on top of HTTP Builder. REST Assured supports any HTTP method but has explicit support for POST, GET, PUT, DELETE, OPTIONS, PATCH and  HEAD and includes specifying and validating e.g. parameters, headers, cookies and body easily. It can be used to validate and verify the response of these requests.

RestAssured is built on top of Apache HTTP Client. Sometimes it is asked why not to use HTTP client directly. The below screenshot should answer this question.

REST Assured is developed and maintained by Johan Haleby. He started the project when he was working at Jayway back in December of 2010. The project is now sponsored by Parkster.

Rest Assured has a legacy version as well and many beginners start using that in confusion. When you search Rest Assured dependency in Maven Central Repo then you will find two different group ids.

com.jayway.restassured – This group is legacy.

io.rest-assured – This group is the latest.

You should start learning from group id “io.rest-assured“.

  1. It is an Open source i.e. free.
  2. It requires less coding compare to Apache Http Client.
  3. The initial setup is easy and straightforward before you hit any endpoint.
  4. Easy parsing and validation of response in JSON and XML.
  5. The extraction of values and asserting is quite easy using inbuilt Hemcrest Matchers.
  6. It follows BDD keywords like given(), when(), then() which makes code readable and supports clean coding. This feature is available from version 2.0.
  7. Rich in syntax.
  8. Very rich in readymade assertions
  9. Quick assertion for status code and response time.
  10. Headers, cookies, Content-Type, etc can be verified on the fly.
  11. Powerful logging mechanism.
  12. Can be easily integrated with other Java libraries like TestNG, Junit as Test Framework and Extent Report, Allure Report for reporting purpose.
  13. Very good support for different authentication mechanisms for APIs.
  14. Can be integrated with Selenium-Java to achieve End to End automation.
  15. Supports JsonPath and XmlPath which helps in parsing JSON and XML response. Rest Assured by default integrates both.
  16. Can be used to verify JSON Schema using JSON Schema Validation library.
  17. Includes XML schema validation
  18. Can be integrated with Maven and CICD.
  19. REST Assured 4.1.2 is released. It adds support for Java 13.
  20. Supports multi-part form data
  21. Supports Spring Mock Mvc, Spring Web Test Client, Scala and Kotlin.
  1. Does not support testing of SOAP APIs explicitly.
  2. Requires good Java programming knowledge
  3. No inbuilt reporting. Serenity BDD is a good option here.

I have started a YouTube channel as well and you can find related Rest Assured video link here:-

Introduction To Rest Assured – English

Introduction To Rest Assured – Hindi

You can download/clone the above sample project from here.

You can subscribe to my YouTube channel RetargetCommon to learn from video tutorials.

If you have any doubt, feel free to comment below.If you like my posts, please like, comment, share and subscribe.#ThanksForReading

#HappyLearning

Uncategorized

Post navigation

Previous Post: Are You Still Using Apache POI – HSSFWorkbook & XSSFWorkbook To Read/Write Excel? Try WorkbookFactory
Next Post: TestNG Tutorials 56: DataProvider in TestNG – Parameterizing DataProvider Method to Provide Data to Multiple Test Methods

Related Posts

relativexpathhelper – Make Selenium Easy Uncategorized
Postman Tutorial Part 4 – Sending GET Request With Query Params in Postman Uncategorized
TestNG Tutorials 48: How to Pass Parameters of Different Datatypes in TestNG | Make Selenium Easy Uncategorized
February 26, 2018 – Make Selenium Easy Uncategorized
August 15, 2018 – Make Selenium Easy Uncategorized
Handling web table in selenium Uncategorized

Recent Posts

  • Getting Started with Selenium 4: What Is New and How to Upgrade from Selenium 3
  • Manual Testing
  • Baby Steps To Become Efficient Selenium-Java Automation Tester
  • Features of Selenium 4.0.0 Release – Java Binding
  • Part 1: Handling Drop-down Created Using SELECT Tag In Selenium

Recent Comments

No comments to show.

Archives

  • April 2026
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • April 2024
  • March 2024
  • February 2024
  • December 2023
  • October 2023
  • August 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • May 2022
  • March 2022
  • October 2021
  • April 2021
  • March 2021
  • January 2021
  • December 2020
  • October 2020
  • September 2020
  • August 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • May 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • January 2018

Categories

  • Getting Started
  • Uncategorized

Copyright © 2026 Make Selenium Easy.

Powered by PressBook Masonry Dark