0% found this document useful (0 votes)
11 views4 pages

Tutorial 10

This document outlines a tutorial for performance testing using Apache JMeter, including installation instructions and detailed tasks. It covers creating basic performance tests, adding parameters, and using a recorder to create test scripts for a chosen website. Additionally, it emphasizes the importance of configuring Thread Groups, Samplers, Timers, and Listeners, and concludes with instructions for submitting a Performance Testing Report.

Uploaded by

Thùy Ngân Phan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views4 pages

Tutorial 10

This document outlines a tutorial for performance testing using Apache JMeter, including installation instructions and detailed tasks. It covers creating basic performance tests, adding parameters, and using a recorder to create test scripts for a chosen website. Additionally, it emphasizes the importance of configuring Thread Groups, Samplers, Timers, and Listeners, and concludes with instructions for submitting a Performance Testing Report.

Uploaded by

Thùy Ngân Phan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Software Quality Assurance

Tutorial 10 – Performance Testing


Preparation
 Install Apache Jmeter:
https://jmeter.apache.org/download_jmeter.cgi
(apache-jmeter-5.6.3.zip)

Tasks
Task 1: A basic performance test
Choose your favorite website to conduct this performance testing. Create one script to test this website by
following these steps:

 Create and configure Thread Groups. A Thread Group represents a group of virtual users that will
execute your test scenario.
o Number of Threads: Each thread simulates one user.
o Ramp-up Period: Time (in seconds) JMeter should take to create all threads.
o Loop Count: How many times each thread should execute the test scenario.
 Create and configure Samplers. Samplers are the elements that perform the actual requests to
your target server. HTTP Request sampler is most common for website testing. Configuration
includes:
o Server name/IP
o Port number
o Protocol (HTTP/HTTPS)
o Method (GET, POST, etc.)
o Path
o Parameters/body data
 Create and configure Timers. Timers add delays between requests to simulate realistic user
behavior. Without timers, JMeter would execute requests as fast as possible, which might not
represent real user behavior. The timer types are:
o Constant Timer: Adds a fixed delay between requests
o Gaussian Random Timer: Adds random delays based on a normal distribution
o Uniform Random Timer: Adds random delays within a range
o Throughput Timing: Controls requests per minute
 Create and configure Listeners (View Tesults Tree). Listeners collect and display test results in
various formats.
o View Results Tree: Shows detailed information for each request
o Aggregate Report: Provides summary statistics (response times, throughput, error
rates)
o Graph Results: Displays graphical representation of performance metrics
o Summary Report: Shows basic statistics in tabular format
 Save the test as .jmx file
 Finally, run and view result

Basic JMeter Test Plan setup:

1. Right-click on "Test Plan" > Add > Threads > Thread Group
2. Configure your Thread Group (users, ramp-up, loops)
3. Right-click on Thread Group > Add > Sampler > HTTP Request
4. Configure your HTTP Request with target website details
5. Right-click on Thread Group > Add > Timer > Constant Timer
6. Configure timer (e.g., 300ms delay between requests)
7. Right-click on Thread Group > Add > Listener > View Results Tree
8. Run the test (green play button)

Task 2: Adding parameters


Choose your favorite website to conduct this performance testing. Create one script and add parameters
to test the website by following these steps:

 Create and configure Thread Groups


 Create and configure Samplers. You can add multiple samplers to create a sequence of actions
(like navigating through a website).

Example: Let’s test a flight booking website. The first script simply searched for flights, this script will
search, then choose a flight.

When you search for a flight in your web browser, and click the “Choose This Flight” button beside the
flight of your choice, note that the next page adds a "/reserve.php" to the URL.

With this in mind, go back to JMeter and add another HTTP Sampler. This time, you’ll not only specify
"website.com", but you’ll add "reserve.php" to the “Path” field. Doing so tells the sampler to build a
full URL of "website.com/reserve.php". Next, add the parameters required to make the selection. To
complete the choice, this page requires you specify a fromPort and toPort, which you’ll designate
“Boston” and “London”, respectively.

 Create and configure Listeners (view View Results in Table)


 Finally, run and view result
Task 3: Using Recorder to create Test Script
A better way to create scripts is by recording them. To record a test scenario for your favorite website,
you can either use the JMeter recorder, or the BlazeMeter Chrome Extension. The BlazeMeter extension,
free to use from the Chrome store, which requires you to set a proxy to redirect the traffic.

Through your Chrome, start recording and simulate the user scenario you want to test by clicking away.
When you’re done, stop the recording, and edit as necessary.

Export your recording to JMX. Don’t forget to move the downloaded script to your preferred folder.

Open the .jmx file file in JMeter. You will be able to see your test plan, which was created from the
recording and the .jmx file.
Note that this plan has new elements, like Cookie Manager and Cache Manager. They are here because
browsers keep cookies and cache, and they were captured in the recording. You can clear them up if you
need to. These entirely optional elements are present to simulate web browser behavior more closely.

Now add a listener and run the test.

Submission
Submit your Performance Testing Report (the .docx file) to the submission box of this tutorial. The
Report should contain important screenshots of the performance/load testing that you performed in the
activities of this tutorial.

You might also like