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

Performance Testing with JMeter - Second Edition

Book Description

Test web applications using Apache JMeter with practical, hands-on examples

In Detail

This book is a practical, hands-on guide that equips you with all the essential skills needed to effectively use JMeter to test web applications using a number of clear, step-by-step recipes.

The book starts with the basics of performance testing and teaches you how to go about recording your first test. The book then focuses on distributed testing, teaching you how to configure master and slave nodes as well as leverage the cloud and launch AWS instances. The book ends with some tips and best practices with regard to performance testing such as how to use the debug sampler, H2 database, dummy sampler, and MongoDB sampler, among others.

By the end of the book, you will have learned how to take full advantage of the real power behind Apache JMeter, quickly taking you from a novice to an expert.

What You Will Learn

  • Set up and prepare Apache JMeter for testing
  • Record test scenarios or create them from scratch
  • Test RESTful web services
  • Effectively monitor resources during performance tests
  • Build realistic, comprehensive, and maintainable test plans
  • Understand distributed testing using Vagrant, AWS, Flood.io, and BlazeMeter
  • Extend JMeter functionality through plugins
  • Understand and effectively use JMeter components to achieve testing needs

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 files e-mailed directly to you.

Table of Contents

  1. Performance Testing with JMeter Second Edition
    1. Table of Contents
    2. Performance Testing with JMeter Second Edition
    3. Credits
    4. About the Author
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Downloading the color images of this book
        3. Errata
        4. Piracy
        5. Questions
    8. 1. Performance Testing Fundamentals
      1. The incident
      2. The aftermath
      3. Performance testing
      4. Performance testing and tuning
        1. Baselines
        2. Load and stress testing
      5. JMeter to the rescue
      6. Up and running with JMeter
        1. Installation
          1. Installing Java JDK
          2. Setting up JAVA_HOME
            1. On Windows
            2. On Unix
          3. Running JMeter
            1. Command-line options
            2. JMeter's Classpath
            3. Configuring a proxy server
            4. Running in non-GUI mode
            5. Running in server mode
            6. Overriding properties
          4. Tracking errors during test execution
          5. Configuring JMeter
      7. Summary
    9. 2. Recording Your First Test
      1. Configuring the JMeter HTTP(S) Test Script Recorder
      2. Setting up your browser to use the proxy server
        1. Using a browser extension
        2. Changing the machine system settings
        3. Running your first recorded scenario
          1. Excilys Bank case study
          2. Parameterizing the script
            1. Extracting information during test run
      3. Anatomy of a JMeter test
        1. Test plan
        2. Thread groups
        3. Controllers
        4. Samplers
        5. Logic controllers
        6. Test fragments
        7. Listeners
        8. Timers
        9. Assertions
        10. Configuration elements
        11. Preprocessor and postprocessor elements
      4. Summary
    10. 3. Submitting Forms
      1. Capturing simple forms
        1. Handling checkboxes
        2. Handling radio buttons
        3. Handling file uploads
        4. Handling file downloads
        5. Posting JSON data
        6. Reading JSON data
          1. Using BSF PostProcessor
        7. Handling XML responses
      2. Summary
    11. 4. Managing Sessions
      1. Managing sessions with cookies
      2. Managing sessions with URL rewriting
      3. Summary
    12. 5. Resource Monitoring
      1. Basic server monitoring
        1. Setting up Apache Tomcat Server
          1. Configuring Tomcat users
          2. Setting up a monitor controller in JMeter
      2. Monitoring the server with a JMeter plugin
        1. Installing the plugins
        2. Adding monitor listeners to the test plan
      3. Summary
    13. 6. Distributed Testing
      1. Remote testing with JMeter
        1. Configuring JMeter slave nodes
          1. Configuring one slave per machine
          2. Configuring the master node
          3. Configuring multiple slave nodes on a single box
          4. Configuring the master node
      2. Leveraging the cloud for distributed testing
        1. Obtaining your access key, secret key, and key pair
        2. Launching the AWS instance
        3. Executing the test plan
        4. Viewing the results from the virtual machines
      3. Using cloud services
        1. Using Flood.io
        2. Using BlazeMeter
      4. Summary
    14. 7. Helpful Tips
      1. JMeter properties and variables
      2. JMeter functions
      3. The Regular Expression tester
      4. The debug sampler
      5. Using timers in your test plan
        1. The Constant Timer
        2. The Gaussian Random Timer
        3. The Uniform Random Timer
        4. The Constant Throughput Timer
        5. The Synchronizing Timer
        6. The Poisson Random Timer
      6. The JDBC Request sampler
        1. Setting up the H2 database
        2. Configuring a JDBC Connection Configuration component
        3. Adding a JDBC Request sampler
      7. Using a MongoDB Sampler
      8. A Dummy Sampler
      9. The JSON Path Extractor element
      10. Handling RESTful web services
      11. Summary
    15. Index