Getting Started With Rest Assured

Learn how to setup a Rest Assured API Testing Framework

Getting Started with Rest Assured

What is Rest Assured?

  • Rest Assured is a Java Domain Specific Language which simplifies testing of RESTful Web Services.
  • It supports all HTTP Request types like GET, POST, PUT, DELETE, OPTIONS, PATCH and HEAD.
  • It can be used to validate and verify the response of different API Requests.
  • It allows requests to be constructed with multiple parameters, headers and their body.
  • Rest Assured DSL is very similar to any BDD language which makes it simple to use and understand.
  • It is an open source project. It is developed/maintained by Johan Haleby and other contributors.

How to setup Rest Assured?

Add the following dependencies to pom.xml:

Write a simple test in Rest Assured

Understanding the syntax:

  • Executes a get request on the API URL: https://api.coindesk.com/v1/bpi/currentprice.json
  • Verifies whether the status code in the response is equal to 200
  • Rest Assured API uses the same syntax as any other BDD language in the form of Given/When/Then format
  • This syntax is easy to understand and also resolves everything starting from setup, execution and verification in one line.

Bijan Patel
Full Stack Test Automation Expert | Selenium Framework Developer | Certified Tosca Automation Specialist | Postman | DevOps | AWS | IC Agile Certified | Trainer | Youtuber | Blogger|

Launch your GraphyLaunch your Graphy
100K+ creators trust Graphy to teach online
𝕏
QASCRIPT 2024 Privacy policy Terms of use Contact us Refund policy