Book Image

Performance Testing with JMeter 3 - Third Edition

By : Bayo Erinle
Book Image

Performance Testing with JMeter 3 - Third Edition

By: Bayo Erinle

Overview of this book

JMeter is a Java application designed to load and test performance for web application. JMeter extends to improve the functioning of various other static and dynamic resources. This book is a great starting point to learn about JMeter. It covers the new features introduced with JMeter 3 and enables you to dive deep into the new techniques needed for measuring your website performance. The book starts with the basics of performance testing and guides you through recording your first test scenario, before diving deeper into JMeter. You will also learn how to configure JMeter and browsers to help record test plans. Moving on, you will learn how to capture form submission in JMeter, dive into managing sessions with JMeter and see how to leverage some of the components provided by JMeter to handle web application HTTP sessions. You will also learn how JMeter can help monitor tests in real-time. Further, you will go in depth into distributed testing and see how to leverage the capabilities of JMeter to accomplish this. You will get acquainted with some tips and best practices with regard to performance testing. By the end of the book, you will have learned how to take full advantage of the real power behind Apache JMeter.
Table of Contents (17 chapters)
Title Page
About the Author
About the Reviewers
Customer Feedback

Handling RESTful web services

An increasing number of applications are shifting to RESTful web services due to their simplicity to build, test, and consume as 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 the 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 will create a new person in our sample application using a POST request, and then we will 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...