Book Image

Performance Testing with JMeter, 2nd Edition

By : Erinle
Book Image

Performance Testing with JMeter, 2nd Edition

By: Erinle

Overview of this book

This book is great for developers, quality assurance engineers, testers, and test managers new to Apache JMeter, or those who are looking to get a good grounding in how to effectively use and become proficient with JMeter. No prior testing experience is required.
Table of Contents (9 chapters)

Handling RESTful web services


An increasing number of applications are shifting to RESTful web services due to their simplicity to build, test, and consume compared to their SOAP counterparts. All REST communication is done over the HTTP protocol between the parties involved. HTTP is used for CRUD (create, read, update, and delete) operations. The built-in HTTP Request sampler in JMeter is more than up to the task. It supports GET, POST, PUT, and DELETE operations, among other things. The body of the request can be in XML or JSON format. An HTTP Header Manager component can be used to send additional HTTP header attributes if needed.

In our sample, we are going to create a new person in our sample application using a POST request, and then verify that the person was actually created using a GET request:

  1. Create a new test plan.

  2. Add a new Thread Group (by navigating to Test Plan | Add | Thread Group).

  3. Add an HTTP Request sampler (this retrieves all the people records in our application so far...