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 3 - Third Edition

Book Description

A practical guide to help you undertand the ability of Apache jMeter to load and performance test various server types in a more efficient way.

About This Book

  • Use jMeter to create and run tests to improve the performance of your webpages and applications

  • Learn to build a test plan for your websites and analyze the results

  • Unleash the power of various features and changes introduced in Apache jMeter 3.0

  • Who This Book Is For

    This book is for software professionals who want to understand and improve the performance of their applications with Apache jMeter.

    What You Will Learn

  • See why performance testing is necessary and learn how to set up JMeter

  • Record and test with JMeter

  • Handle various form inputs in JMeter and parse results during testing

  • Manage user sessions in web applications in the context of a JMeter test

  • Monitor JMeter results in real time

  • Perform distributed testing with JMeter

  • Get acquainted with helpful tips and best practices for working with JMeter

  • In Detail

    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.

    Style and approach

    The book is a practical guide starting with introducing the readers to the importance of automated testing. It will then be a beginner’s journey from getting introduced to Apache jMeter to an in-detail discussion of more advanced features and possibilities with it.

    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. 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. Errata
        3. Piracy
        4. Questions
    2. 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
        2. 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
      7. Tracking errors during test execution
      8. Configuring JMeter
      9. Summary
    3. 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
    4. 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 JSR223 PostProcessor
        7. Handling XML responses
      2. Summary
    5. Managing Sessions
      1. Managing sessions with cookies
      2. Managing sessions with URL rewriting
      3. Summary
    6. Monitoring Tests in Real-Time
      1. Setting up InfluxDB
      2. Setting up Grafana
      3. Creating an InfluxDB database for our test plan
        1. Connecting Grafana to the database
      4. Putting it all together
        1. Importing the Grafana dashboard
      5. Summary
    7. 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
    8. Helpful Tips - Part 1
      1. Dummy Sampler
      2. Debug Sampler
      3. JDBC Request Sampler
        1. Setting up the H2 database
        2. Configuring a JDBC Connection Configuration component
        3. Adding a JDBC Request Sampler
      4. Using a MongoDB Sampler
      5. Summary
    9. Helpful Tips - Part 2
      1. JMeter properties and variables
      2. JMeter functions
      3. 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
      4. The Regular Expression tester
      5. The JSON Path Extractor element
      6. Handling RESTful web services
      7. Working with the reporting dashboard
      8. Summary