Featured

Stress Testing web application with JMeter HTTP(S) Test Script Recorder

Introduction 

 A critical component of performance testing is stress testing, which assesses how a web application performs in harsh scenarios like large data loads, significant traffic, or constrained system resources. Finding the application's breaking point and confirming that it can recover gracefully from failure without data loss or significant downtime are the primary goals of stress testing. The robust Script Recorder feature of Apache JMeter, a popular open-source performance testing tool, enables testers to record actual user interactions with a web application and turn them into test scripts. To simulate multiple concurrent users accessing the application at the same time, these scripts can then be run with different loads.


1. Steps to Setup

Step 01: Download requirements.

  1. Download Java to your device. download java
  2. After successfully installing Java, download JMeter
  3. Extract the file and go to the file path \apache-jmeter-5.6.3\bin  and open ApacheJMeter.jar


  

Step 02: Create Test Plan

Setting up the JMeter setup for recording test scripts correctly is crucial before beginning stress testing on a web application. With the help of Apache JMeter's integrated HTTP(S) Test Script Recorder, testers can record in-the-moment browser activity and turn it into test scripts. Later on, these scripts can be used to analyze system performance under load and simulate multiple users. This section involves setting up the HTTP(S) Test Script Recorder, adding necessary elements such a Thread Group and recording controller, and creating a new test plan in JMeter. This configuration serves as the basis for logging and running web requests, which will subsequently be utilized for application stress testing.


1. Create new Test plan File > new 
2. Right-click on the test plan, and select add > Threads > Thread Group.
         

3. Right-click on test plan, select add > Non-test element  > HTTP(S) Test Script Recorder
 



4. After adding a thread group, right-click on thread group select, Logical controller >Recoding controller
Now your setup is ready


Step 03: Proxy setup

After setting up the basic JMeter Test Plan, the next step is to configure the proxy settings to enable the recording of browser requests. The HTTP(S) Test Script Recorder in JMeter works as a proxy server that captures all HTTP and HTTPS traffic between the browser and the web application. By default, it listens on port 8888.

To start recording user actions, the computer’s network proxy must be configured to route traffic through JMeter’s proxy port. Once the proxy is set up correctly, all browser interactions with the target web application will be recorded automatically into JMeter, allowing for accurate test script generation.


  1. Click HTTP(S) Test Script Recorder on your setup test plan; you can see port 8888. 

  2. Go to the proxy setting of your PC set-up proxy like this, then your proxy is ready

Proxy Setup on Firefox 

  1. Open Firefox.
    • Launch the Firefox browser on your computer.
  2. Go to Settings.
    • Click the menu icon (☰) in the top-right corner and select Settings (or Options on some versions).
  3. Search for Proxy Settings.
    • In the Settings search bar, type “proxy” and click “Settings…” under Network Settings.
  4. Choose Manual Proxy Configuration. In the Connection Settings window:
    • Select Manual proxy configuration.
    • In the HTTP Proxy field, enter: localhost
    • In the Port field, enter: 8888
  5. Apply Settings.
    • Check the box “Use this proxy server for all protocols.”
  6. Confirm and Save.
    • Click OK to save your proxy configuration.



Step 04: Browser setup

2. Scroll down and select the icon in the Manage import certificate window; you’ll get a window like this:
3.Then select import, select the file \apache-jmeter-5.6.3\apache-jmeter-5.6.3\bin\ApacheJMeterTemporaryRootCA.crt from Jmeter installed location


  1. Firefox  visit about:preferences#privacy   
  2. View Certificate>click  import : apache-jmeter-5.6.3\apache-jmeter-5.6.3\bin\ ApacheJMeterTemporaryRootCA.crt

Step 05 : Recode testing

1. Go to the stepped plan of the Jmeter
2. Select HTTP(S) Test Script Recorder
3. Select the recording controller in target controller 
 


4. Then click start, you’ll get windows like this
 

5. With that window, go to the browser and do the web app testing by its flow. After you done , click stop in the recorder.

 

Step 06: Starting Testing

1. Right Click on Test Plan select


2. Then Click on thread group , Insert the number of users , Ramp-up & loop count
3. Then click Start button 
 


4. After the test done view Summery report 

2. JMeter Scripting and Configuration Best Practices

Since the document is procedural, make sure it highlights the following high-impact JMeter efficiency and accuracy tips:

Parameterization and Variables

·         Use Data Files (CSV Data Set Config): Emphasize replacing hardcoded user credentials, IDs, or other session data with variables pulled from a CSV file. This is essential for simulating unique users and preventing user-blocking issues.

·         Use User Defined Variables (UDVs): Suggest setting common configuration values (like the server IP and the protocol/port) in the User Defined Variables element at the Test Plan level. This makes the script easily maintainable if the environment changes.

Timers and Realism

·         Add Timers: Ensure the document specifies using Timers (like Constant Timer or Gaussian Random Timer) to introduce a realistic delay between requests. This simulates a user's "think time" and prevents aggressive request bursts that are unrealistic.

Response Validation

·         Use Response Assertions: While the document mentions adding assertions, stress that they are vital. Response Assertions must be used on every critical request to verify the response content (e.g., checking for a specific success message or text). Without this, a test might report a "200 OK" status code but be serving an incorrect or error-laden page.

 


 

3. Test Execution Guidelines

The steps in your document regarding "Starting Testing" (Step 06) should include explicit instructions on running the load test correctly.

·         Run in Non-GUI Mode: Crucially, state that the actual load test must be executed from the command line (non-GUI mode). Running in GUI mode consumes excessive memory and skews the test results, especially under heavy load.

·         Disable Listeners: Instruct users to disable or remove memory-intensive Listeners (like View Results Tree or View Results in Table) during the load test run. The document mentions a Listener for a summary; if it is an Aggregate Report, it should only be used for debugging or post-run analysis. Data logging should be done to a .jtl file using the command line flag, and reports generated after the test is complete.

Conclusion

Stress testing a web application using Apache JMeter and its HTTP(S) Test Script Recorder is an effective approach to evaluate system performance under extreme conditions. By capturing real user interactions and simulating heavy loads, testers can identify performance bottlenecks, scalability issues, and system limitations before they impact end users.

This process ensures that the application can maintain stability, responsiveness, and reliability even during peak usage. Configuring JMeter’s proxy recorder, creating an organized test plan, and executing stress scenarios provide valuable insights into the application’s capacity and recovery behavior.

Overall, stress testing with JMeter helps improve the quality and robustness of web applications, enabling development teams to deliver a more resilient and high-performing product.

Have a nice day! ✨

-Madushan Joel-

Comments