Book Image

JMeter Cookbook

By : Bayo Erinle
Book Image

JMeter Cookbook

By: Bayo Erinle

Overview of this book

Table of Contents (16 chapters)
JMeter Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using Duration Assertion


Another useful assertion component that comes bundled with JMeter is the Duration Assertion component. Like its name implies, this component is used to test that each response returns within a given time specified by the user. Any response that doesn't return within the specified time is marked as a failed response. For example, this can be particularly useful when testing API calls for application services, or ensuring the accumulative service calls to render a page are all performing efficiently.

How to do it…

In this recipe, we will cover how to use the Duration Assertion component. Perform the following steps:

  1. Launch JMeter.

  2. Add Thread Group to the new test plan by navigating to Test Plan | Add | Threads (Users) | Thread Group.

  3. Add the HTTP Request sampler by navigating to Thread Group | Add | Sampler | HTTP Request.

  4. Fill in its attributes in the following way:

    • Server Name or IP: evening-citadel-2263.herokuapp.com

    • Method: GET

    • Path: N/A

  5. Add the Duration Assertion component...