Create An Automated API Check That Asserts The Body Of A Response

Mark Winteringham's profile
Mark Winteringham

Tester, Toolsmith, Author and Instructor

Challenge Description

Using restful-booker, send an HTTP request to create a booking and then assert that the correct details are returned in the HTTP response. For example, if you set the first name as "Mark", then HTTP response will come back with a booking that has a first name of "Mark"

Hints:

  • You can get more information about creating a booking in the restful-booker API docs.
  • Restful-booker resets every ten minutes. Meaning you cannot rely on stored bookings from the past.
What you’ll learn
  • Construct an automated API check that can assert an HTTP response body

Prerequisites

Whilst this challenge is language agnostic (you can complete it using any tool or language you want) you will need to ensure all necessary SDKs and libraries are installed.

Resources

You can learn more about API automation in the API automation topic page. Here are some additional resources:

Courses

Blogs

Practise sites

  • restful-booker.herokuapp.com - A practise API that contains documentation (and bugs to find). An excellent place to start your API testing against

Code

  • API Frameworks - A compilation of different API frameworks built in different languages that can be used to kickstart an API automation framework

Books

  •  Testing Web APIs by Mark Winteringham - A comprehensive book that covers a range of API testing activities, including automation
In-Sprint Test Automation On Agile Teams: Yes You Can!
Ask Me Anything - Simon Stewart
Sustainable Test Automation: From Garden to Ecosystem
Feature Spotlight - TestCompass: Impact Analysis
Kill the Mutants! - Nico Jansen & Simon de Lang
You Can Become a Toolsmith Too! - Matthew Bretten
Approach to Comparing Tools with Shweta Sharma
ReTestBash UK 2022: Live Q&A with Julia Pottinger
Breaking Boundaries Using Charles - Suman Bala
This open-source tool is the #1 Automation Test Reporting Tool loved by the community and the developing team plans to share their knowledge via a learning course. Stay tuned!
Explore MoT
TestBash Brighton 2024
Thu, 12 Sep 2024, 9:00 AM
We’re shaking things up and bringing TestBash back to Brighton on September 12th and 13th, 2024.
MoT Foundation Certificate in Test Automation
Unlock the essential skills to transition into Test Automation through interactive, community-driven learning, backed by industry expertise