O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Apache JMeter

Book Description

A practical beginner's guide to automated testing and performance measurement for your websites

About This Book

  • Test your website and measure its performance

  • Master the JMeter environment and learn all its features

  • Build test plan for measuring the performance

  • Step-by-step instructions and careful explanations

  • Who This Book Is For

    The ideal readers or users of this book are experienced or novice testers who have been testing manually and now would like to automate their tests. Those testers who are already automating their testing using other tools or testing software may also want to use this book as they look for alternatives. This book would also be a good point for test Managers/Leaders to start doing research on the test automation tool that may best suit their testing needs and of course, their budget

    JMeter's target audience is the testing community, which is generally not the hangout of developers or technical people. Almost anything one would like to do in HTTP testing will be supported by JMeter without requiring any programming.

    The user need not have much technical knowledge to work with JMeter. It has a simple-to-use and intuitive drag-and-drop style GUI that helps any non-technical user to get started.

    What You Will Learn

  • Why automating tests is so useful, and how it will help you to improve performance of your web sites and applications

  • Installing, setting up the environment, and running JMeter

  • Planning automated tests to provide a thorough insight into application performance, bottle necks, and load bearing capabilities

  • Building a test plan to test your websites

  • Test web, database, FTP servers and more – so you can get a detailed insight into which parts of your application are holding up performance

  • Build more complex test elements using regular expressions and functions

  • Capture, process, and analyse test results

  • In Detail

    A bad response time on a website can drive away visitors and prospective customers. To measure what a website can handle, there should be a way to simulate and analyze different load scenarios—this is where a load-testing tool like JMeter comes in. JMeter is a powerful desktop performance tool from the Apache Jakarta project, written in Java, for load-testing web pages, web applications, and other static and dynamic resources including databases, files, Servlets, Perl scripts, Java Objects, FTP Servers, and more.

    JMeter works by acting as the "client side" of an application, and measures response time. As such, it's one half of the testing arsenal; the other half consists of a tool to watch metrics on the server side, such as thread counts, CPU loads, resource usage, and memory usage. Although it can't behave like a browser to measure rich client-side logic such as JavaScripts or Applets, JMeter certainly measures the performance of the target server from the client's point of view. JMeter is able to capture test results that help you make informed decisions and benchmark your application.

    This book introduces you to JMeter (version 2.3) and test automation, providing a step-by-step guide to testing with JMeter. You will learn how to measure the performance of a website using JMeter.

    While it discusses test automation generally, the bulk of this book gives specific, vivid, and easy-to-understand walkthroughs of JMeter's testing tools showing what they can do, and when and how to use them.

    Style and approach

    This book is focussed on learning and understanding JMeter. It starts with a basic introduction and installation, followed by using JMeter to test web applications. It proceeds to show how to use JMeter to perform load testing and also to test the functional behavior of the target web application. The discussion continues to include testing servers other than web application servers, and demonstrates the use of some of JMeter's built-in functions. This book aims to give readers an introductory view of JMeter, and gives a brief and realistic overview to those researching for an ideal testing tool to use in testing projects.

    The book is written in a straightforward, clear way, with plenty of step-by-step instructions and illustrative screenshots.

    Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

    Table of Contents

    1. Apache JMeter
      1. Table of Contents
      2. Apache JMeter
      3. Credits
      4. About the Author
      5. Preface
        1. What The Book Is About
        2. What This Book Covers
        3. What You Need for This Book
        4. Who This Book Is For
        5. Conventions
        6. Reader Feedback
        7. Customer Support
          1. Downloading the Example Code for the Book
          2. Errata
          3. Questions
      6. 1. Automated Testing
        1. Why Automate Testing?
        2. To Automate or Not to Automate—Some Hints
        3. How Much Does it Cost?
        4. Summary
      7. 2. Introduction to JMeter
        1. The Humble Beginning
        2. The Features—What JMeter Can Do for You
        3. The Look-How-Easy-to-Use GUI
        4. The Requirements
        5. Summary
      8. 3. Getting Started
        1. Installing JMeter
          1. Setting the Environment
        2. Running JMeter
        3. Summary
      9. 4. The Test Plan
        1. What Is a Test Plan?
        2. Elements of a Test Plan
          1. Thread Group
          2. Controllers
            1. Samplers
            2. Logic Controllers
          3. Listeners
          4. Timers
          5. Assertions
          6. Configuration Elements
          7. Pre-Processor Elements
          8. Post-Processor Elements
        3. Building a Test Plan That Tests Web Sites
          1. Adding Users
        4. Summary
      10. 5. Load/Performance Testing of Websites
        1. Preparing for Load Testing
          1. What You Need to Know
          2. Some Helpful Tips to Get Better Results
        2. Using JMeter Components
          1. Recording HTTP Requests
          2. Creating the Test Plan
          3. Adding Listeners
          4. Adding Timers
        3. Running the Test Plan
        4. Interpreting the Results
        5. Remote Testing with JMeter
        6. Monitoring the Server's Performance
        7. Summary
      11. 6. Functional Testing
        1. Preparing for Functional Testing
        2. Using JMeter Components
          1. Using HTTP Proxy Server to Record Page Requests
            1. Configuring the Proxy Server
            2. Adding HTTP Request Default
            3. Adding HTTP Header Manager
          2. Let the Recording Begin...
          3. Adding User Defined Variables
        3. Running the Test
        4. Summary
      12. 7. Advanced Features
        1. Extending the Web Test Plan
          1. Using the ForEach Controller
          2. Using the While Controller and the StringFromFile Function
          3. Using the Loop Controller and the StringFromFile Function
          4. Using Regular Expressions
        2. Testing a Database Server
        3. Testing an FTP Server
        4. Summary
      13. 8. JMeter and Beyond
        1. Summary
      14. A. Component Description
      15. B. Resources
        1. Useful References
        2. Weblogs/Articles on Experience of Using JMeter
      16. C. Glossary
      17. Index