HTTPS Test Script Recorder in JMeter

Jul 12, 2024

HTTPS Test Script Recorder in JMeter

Overview

  • Purpose: Learn about the HTTPS Test Script Recorder in JMeter and how to use it from scratch
  • Questions Answered:
    • What is the Test Script Recorder?
    • Why do we need it?
    • When should it be used?
    • How to use it?

Key Concepts

  • Test Script Recorder: An element in JMeter that helps record HTTP requests from the browser.

Steps and Processes

Creating a Test Plan

  1. Add Test Script Recorder:
    • Open JMeter and create a new test plan.
    • Right-click on 'Test Plan' > 'Add' > 'Non-Test Elements' > 'HTTPS Test Script Recorder'.
  2. Add Thread Group:
    • Right-click on 'Test Plan' > 'Add' > 'Threads (Users)' > 'Thread Group'.
  3. Add Recording Controller:
    • Inside 'Thread Group', right-click > 'Add' > 'Logic Controller' > 'Recording Controller'.
    • Multiple recording controllers can be added for different pages (e.g., Home Page, Archives Page, About Page).
    • Name the controllers for organization.

HTTPs Test Script Recorder Options

  • Name: Can be customized; default is HTTPS Test Script Recorder.
  • Port: Default is 8888; can be changed.
  • Target Controller: Select which recording controller to use (e.g., Home).
  • Grouping Options: Choose whether to group samplers.
  • Request Filtering: Include/exclude specific URL patterns.

Setting Up Proxy

  • Browser Proxy:
    • Open browser settings and search for 'Proxy'.
    • Set 'Manual Proxy' to localhost and port to 8888.
    • Proxy setup can also be done at the system level.
  • Add Certificate:
    • Go to security settings in the browser and manage certificates.
    • Import the certificate from JMeter’s bin folder.
    • Certificate file: ApacheJMeterTemporaryRootCA.crt.

Recording Traffic

  1. Start Recording:
    • Click 'Start' on the HTTPS Test Script Recorder.
    • Perform actions on the target website.
    • Recorded actions appear under the selected recording controller.
  2. Organize Recordings:
    • Use multiple recording controllers for different sections of the website.
    • Rename samplers for easy identification.

Using Listeners

  • View Results:
    • Add listeners like 'View Results Tree' and 'View Results in Table' to see recorded results.
    • Right-click on 'Thread Group' > 'Add' > 'Listener' > select desired listener.

Saving the Test Plan

  • Save the test plan for future use: File > Save As.

Using Templates

  1. Templates in JMeter:
    • Go to 'File' > 'Templates' or click the template icon.
    • Select 'Recording with Think Time' to mimic real-world user behavior with random delays.
  2. Recording Templates:
    • Predefined settings and elements like request filtering.
    • Configuration for common patterns exclusion.