Testing RESTful Services, Part 1: Test Creation

Try it with a GUI tool first, then proper and more flexible test scripting in Ruby.

Zhimin Zhan

--

A repost of my daughter’s article with permission. I added a few notes. The scripts are based on my book: API Testing Recipes in Ruby.

Update: Part 2: Run frequently in a Continuous Testing Server.

RESTful web services are based on the Representational State Transfer (REST) architecture. In a RESTful service, payloads are in some uniform format (e.g. JSON, HTML, XML, etc), via HTTP.

I will use a sample REST service site, Thomas Bayer, for examples to test typical RESTful services: LIST, READ, CREATE, UPDATE and DELETE records.

Table of Contents:
My API Testing Approach
· LIST all records
· READ a record
· CREATE a new record
· UPDATE a record
· DELETE a record
· Review (Zhimin)

My API Testing Approach

Here’s how I write API tests (including SOAP, REST and others):

  1. Try the request in a GUI API tool (like Postman, Paw, etc), which can view request data and response…

--

--