PayFlow Load & Stress Testing using Apache JMeter
Business Scenario
Welcome back to the PayFlow Project. In the previous lab, you learned the fundamentals of Performance Testing, identified key performance metrics, created performance test scenarios, and prepared a performance test plan. As a DevOps QA Engineer, your next responsibility is to execute performance tests using Apache JMeter, one of the most widely used open-source performance testing tools. As your QA Manager, I want you to understand how to simulate multiple users accessing the PayFlow application simultaneously and analyze how the system behaves under different workloads. In this lab, you will install
Pre-Lab Preparation
and configure Apache JMeter, create load testing scripts for the PayFlow application, execute load and stress tests, and analyze performance reports to identify bottlenecks and system limitations. By the end of this lab, you will be able to perform real-world performance testing and evaluate the application's stability under heavy user traffic.
Topic : Weaving the world of Web
1) Install Apache JMeter
2) Create load test scripts
3) Execute stress tests
4) Analyze system behavior
Task 1:Install and Configure Apache JMeter
1
Understand Apache JMeter
a
What is Apache JMeter?
Apache JMeter is an open-source performance testing tool developed by the Apache Software Foundation. It is used to perform Load Testing, Stress Testing, Performance Testing, and API Testing for web applications, web services, and databases.
JMeter simulates multiple virtual users sending requests to an application and measures how the application performs under different workloads.
b
What is Apache JMeter?
JMeter follows these steps:
Create a Test Plan.
Configure virtual users using a Thread Group.
Add HTTP Requests.
Execute the test.
Send requests to the application.
Collect response data.
Generate performance reports.
c
Example (PayFlow Project)
The QA team wants to verify whether the PayFlow Payment Module can handle 500 users simultaneously.
JMeter creates 500 virtual users, sends payment requests to the application, measures response time, throughput, and error rate, and generates a performance report.
2
Install Java (JDK) and Verify Prerequisites
a
What are Prerequisites?
Prerequisites are the software components that must be installed before JMeter can run successfully.
The most important prerequisite is the Java Development Kit (JDK).
How Does It Work?
b
Download and install JDK.
Configure the JAVA_HOME environment variable.
Add Java to the system PATH.
Open Command Prompt.
Verify the installation using:
java -version
The installed Java version should be displayed.
c
a
Example (PayFlow Project)
Before installing JMeter, the QA Engineer verifies Java installation.
Example Output:
java version "21.0.2"
Java(TM) SE Runtime Environment
This confirms that Java is installed successfully.
3
Download and Install Apache JMeter
What is JMeter Installation?
JMeter installation involves downloading the Apache JMeter package, extracting its contents, and preparing it for execution.
Unlike many applications, JMeter does not require a traditional installation wizard.
b
How Does It Work?
Download the Apache JMeter ZIP file from the official Apache website.
Extract the ZIP file.
Open the extracted folder.
Navigate to:bin
Locate:jmeter.bat
c
Example (PayFlow Project)
The QA Engineer downloads Apache JMeter, extracts it to:
C:\ApacheJMeter
and launches jmeter.bat to begin creating performance tests for the PayFlow application.
a
What is the JMeter Interface?
The JMeter Interface is the graphical user interface (GUI) used to create, configure, execute, and monitor performance test plans.
b
How Does It Work?
Launch JMeter by executing:
jmeter.bat
The main interface displays:
Menu Bar
Toolbar
Test Plan
Workbench
Tree View
Configuration Panel
4
Launch JMeter and Explore the Interface
a
What is Installation Verification?
Installation Verification confirms that JMeter is functioning correctly and all required components are available before creating test plans.
b
How Does It Work?
Launch JMeter.
Create a new Test Plan.
Add a Thread Group.
Add an HTTP Request Sampler.
Save the Test Plan.
Confirm that no startup errors occur.
If all components work correctly, JMeter is ready for use.
5
Verify JMeter Installation
c
Example (PayFlow Project)
The QA Engineer successfully launches JMeter, creates a PayFlow Performance Test Plan, adds a Thread Group and an HTTP Request, and saves the file. This confirms that the JMeter installation is complete and ready for the next task.
Task 2: Create Load Test Scripts
1
Create a New Test Plan
What is a Test Plan?
a
A Test Plan is the main container in JMeter that stores all the components required for performance testing, such as Thread Groups, HTTP Requests, Timers, Assertions, and Listeners.
b
How Does It Work?
Open Apache JMeter.
Click File → New.
A new Test Plan is created.
Rename it to PayFlow Load Test Plan.
Save the Test Plan.
Example (PayFlow Project)
c
Create a Test Plan named PayFlow Load Test Plan to test the application's payment module under load
a
What is a Thread Group?
A Thread Group represents a group of virtual users that execute the test. It controls the number of users, ramp-up time, and loop count during test execution.
2
Configure a Thread Group
b
How Does It Work?
Right-click Test Plan.
Select Add → Threads (Users) → Thread Group.
Configure:
Number of Threads (Users): 100
Loop Count: 5
Save the configuration.
c
Example (PayFlow Project)
Configure the Thread Group to simulate 100 users accessing the PayFlow application and making payment requests.
3
Add HTTP Request Sampler
a
What is an HTTP Request Sampler?
An HTTP Request Sampler sends HTTP requests (GET or POST) to the target application during performance testing. It simulates user actions such as opening a webpage or submitting a payment request.
b
How Does It Work?
Right-click Thread Group.
Select Add → Sampler → HTTP Request.
Enter:
Server Name/IP
Protocol (HTTP/HTTPS)
Request Method (GET/POST)
Path (e.g., /login)
Save the sampler.
c
Example (PayFlow Project)
Create an HTTP Request for the Login Page of the PayFlow application using the GET method.
Activity
Demonstrate how to add an HTTP Request.
4
Add Listeners to View Results
a
What are Listeners?
Listeners are JMeter components that collect, display, and store test execution results. They help testers analyze response times, throughput, errors, and overall application performance.
b
How Does It Work?
Create an HTTP Request for the Login Page of the PayFlow application using the GET method.
Right-click Thread Group.
Select Add → Listener.
Add:
View Results Tree
Summary Report
Aggregate Report
Save the Test Plan.
c
Example (PayFlow Project)
Add a Summary Report and View Results Tree to monitor payment request execution and analyze response times.
a
What is Script Verification?
Script Verification is the process of checking that all components of the Test Plan are correctly configured before running the performance test.
Activity
Show different types of Listeners.
5
Save and Verify the Load Test Script
b
How Does It Work?
Review the Test Plan.
Verify the Thread Group settings.
Check the HTTP Request configuration.
Confirm the Listeners are added.
Save the Test Plan as PayFlow_Load_Test.jmx.
c
Example (PayFlow Project)
The QA Engineer reviews the Test Plan, verifies all components, and saves the script as PayFlow_Load_Test.jmx, making it ready for execution in the next task.
a
What is Load Testing?
Load Testing is a type of performance testing used to evaluate how an application performs under the expected number of users or transactions.
Task 3: Execute Load and Stress Tests
1
Understand Load Testing and Stress Testing
b
What is Stress Testing?
Stress Testing is a type of performance testing used to determine how an application behaves beyond its expected capacity until it reaches its breaking point.
c
How Does It Work?
Configure the number of virtual users.
Execute the JMeter Test Plan.
Simulate user requests.
Collect performance data.
Analyze system behavior.
d
Example (PayFlow Project)
Load Test: Simulate 500 users making payments simultaneously.
Stress Test: Increase the load to 1000 users to observe how the application behaves under heavy traffic
2
Execute the Load Test
a
What is Load Test Execution?
Load Test Execution is the process of running the JMeter Test Plan with the expected number of virtual users to evaluate application performance under normal conditions.
b
How Does It Work?
Open the PayFlow_Load_Test.jmx file.
Verify the Thread Group settings.
Click the Start (â–¶) button.
JMeter creates virtual users.
Requests are sent to the PayFlow application.
Performance data is collected.
c
Example (PayFlow Project)
Execute a Load Test with:
Users: 500
Ramp-Up Time: 50 Seconds
Loop Count: 5
Observe how the Payment Module responds to multiple user requests.
a
What is Stress Test Execution?
Stress Test Execution involves running the application with more users than its expected capacity to determine the system's breaking point.
3
Execute the Stress Test
b
How Does It Work?
Increase the number of users.
Modify the Thread Group.
Execute the Test Plan.
Observe server response.
Record failures and response times.
c
Example (PayFlow Project)
Configure:
Users: 1000
Ramp-Up Time: 60 Seconds
Loop Count: 5
Monitor whether the payment application continues processing transactions or begins failing under heavy load.
a
What is Test Monitoring?
Test Monitoring is the process of observing application performance during test execution by viewing JMeter listeners and system behavior.
b
How Does It Work?
Execute the Test Plan.
Open JMeter Listeners.
Observe:
Active Threads
Response Time
Throughput
Error Rate
4
Monitor Test Execution
Record observations.
c
Example (PayFlow Project)
While executing the Payment Module test, monitor:
Response Time
Active Users
Successful Transactions
Failed Transactions
a
What is Test Completion Verification?
5
Verify Test Completion
Learn how to verify that the performance test has completed successfully and ensure all results have been generated.
Test Completion Verification is the process of confirming that the Load and Stress Tests have finished successfully and that all required performance data has been collected.
b
How Does It Work?
Wait for all virtual users to finish execution.
Confirm that the Thread Group has completed.
Verify that no unexpected execution errors occurred.
Save the test results.
Prepare reports for analysis.
C
Example (PayFlow Project)
The QA Engineer confirms that all 500 Load Test users and 1000 Stress Test users completed execution successfully. JMeter generates reports that will be analyzed in the next task to evaluate application performance.
Task 4: Analyze Performance Reports
1
Understand JMeter Performance Reports
a
What are JMeter Performance Reports?
JMeter Performance Reports display the results of performance testing. These
b
How Does It Work?
Execute the JMeter Test Plan.
Open the Listener reports.
Review the collected performance data.
Analyze the performance metrics.
Prepare conclusions.
c
Example (PayFlow Project)
reports contain performance metrics that help QA engineers understand how the application behaved during Load and Stress Testing.
Common reports include:
Summary Report
Aggregate Report
View Results Tree
Graph Results
a
What is Response Time?
Response Time is the time taken by the application to respond to a user request.
After executing the Payment Module test, the QA Engineer opens the Summary Report to review the response time, throughput, and error rate of the payment transactions.
2
Analyze Response Time and Throughput
b
What is Throughput?
Throughput is the number of requests or transactions processed by the application in a given period.
c
How Does It Work?
Open the Summary Report.
Check the Average Response Time.
Review the Throughput value.
Compare the results with expected targets.
d
Example (PayFlow Project)
Results:
Average Response Time: 1.8 Seconds
Throughput: 650 Requests/Minute
These values indicate that the PayFlow application is performing within the expected limits.
a
What is Error Rate?
Open the Summary Report.
Check the Average Response Time.
Review the Throughput value.
Compare the results with expected targets.
3
Analyze Error Rate and Active Users
Learn how to identify failed requests and analyze user load during performance testing.
b
Example (PayFlow Project)
Results:
Average Response Time: 1.8 Seconds
Throughput: 650 Requests/Minute
These values indicate that the PayFlow application is performing within the expected limits.
a
What are Performance Bottlenecks?
Performance Bottlenecks are components that reduce application performance and increase response time. They prevent the system from handling user requests efficiently.
4
Identify Performance Bottlenecks
b
How Does It Work?
Review all JMeter reports.
Identify requests with high response times.
Analyze failed transactions.
Determine possible causes.
Document improvement recommendations.
c
Example (PayFlow Project)
The Payment API shows a response time of 5 seconds, while other pages respond within 2 seconds. The QA team identifies the Payment API as the performance bottleneck and recommends optimizing database queries.
a
What is a Performance Analysis Summary?
A Performance Analysis Summary is a report that presents the overall results of performance testing, including KPI values, observations, bottlenecks, and recommendations.
5
Prepare the Performance Analysis Summary
b
How Does It Work?
Collect all report data.
Review KPIs.
Document observations.
List identified bottlenecks.
Provide recommendations.
Conclude whether the application passed the performance test.
c
Example (PayFlow Project)
Performance Test Summary
Response Time: 1.8 Seconds
Throughput: 650 Requests/Minute
Error Rate: 0.8%
Concurrent Users: 500
Good Job!!
Congratulations! You have successfully completed the PayFlow Load & Stress Testing using Apache JMeter lab. In this lab, you installed and configured Apache JMeter, created load testing scripts, executed load and stress tests using virtual users, and analyzed performance reports such as Response Time, Throughput, and Error Rate. You also learned how to identify performance bottlenecks and evaluate the stability of the PayFlow application under different workloads. This practical experience prepares you to perform real-world performance testing in DevOps and CI/CD environments.
Checkpoint
Good Job!!
Congratulations! You have successfully completed the PayFlow Load & Stress Testing using Apache JMeter lab. In this lab, you installed and configured Apache JMeter, created load testing scripts, executed load and stress tests using virtual users, and analyzed performance reports such as Response Time, Throughput, and Error Rate. You also learned how to identify performance bottlenecks and evaluate the stability of the PayFlow application under different workloads. This practical experience prepares you to perform real-world performance testing in DevOps and CI/CD environments.
Next-Lab Preparation
Topic : Weaving the world of Web
1) Measure response time
2) Analyze throughput
3) Identify bottlenecks
4) Document findings