Performance Test using JMeter

Junialdi Dwijaputra
4 min readAug 31, 2022

--

Performance Test

Performance Testing is the process of testing the limits of resilience and stability of a system. The part that is tested is the application module and its infrastructure.

Why do we need a performance test for our product?

Organizations do performance testing for at least one of the reasons listed below:

  • To ascertain whether the application meets performance criteria (for instance, the system should handle up to 1,000 concurrent users).
  • To identify compute bottlenecks in an application.
  • To determine whether a software vendor’s promised performance levels are accurate.
  • To compare two or more systems and determine which one works better.
  • To assess stability during high traffic occurrences.

What is JMeter?

JMeter Performance Testing is a way of testing the performance of a web application that uses Apache JMeter. JMeter for performance testing allows you to test both static and dynamic resources, detect concurrent visitors on your website, and do a range of graphical analyses. JMeter performance testing comprises web application load and stress tests.

There are three steps to implement the performance test using JMeter

  1. Add Thread Group
  2. Add JMeter Elements
  3. Run Test & Get the Result

Before start with that three steps you can download JMeter with this link https://jmeter.apache.org/download_jmeter.cgi

Step 1 — Add Thread Group

  1. Start JMeter usually u can find the file at bin folder with batch (.bat) type of file
  2. Select test plan and rename it ( Add -> Threads (Users) -> Thread Group)
  3. Add thread group, you can rename based on request API that will be tested
  4. Setting the thread properties
  5. Number of Threads: 100 (Number of users connects to the target website: with targeted user number)
    Loop Count: Number of time to execute testing
    Ramp-Up Period: JMeter is told how long to wait before beginning the next user.

Step 2 — Add JMeter Elements

  1. Add HTPP Header Manager (Right-clicking the Thread Group and choosing Add -> Config Element -> HTTP Header Manager
  • Fill Content-Type and Accept with application/json
  • Add other header request based on API Documentation for this picture below I add access token

2. Add User Defined Variables(Right-clicking the Thread Group and choosing Add -> Config Element -> User Defined Variable

  • Fill name based_url with value target URL without https://
  • Fill protocol with https

3. Add HTTP Request (Right-clicking the Thread Group and choosing Add -> Sampler -> HTTP Request

  • Set up HTTP Request based on API Documentation (GET/POST/DELETE/PUT)
  • Fill Server Name or IP with ${base_url}
  • Fill Protocol with ${protocol}
  • Fill path with destination based on API documentation

Step 3 — Run the test and get the result

Add three type of report

  1. View Result Tree (Right-clicking the Thread Group and choosing Add -> Listener -> View Result Tree

2. View Result in Table (Right-clicking the Thread Group and choosing Add -> Listener -> View Result in Table

3. Summary Report(Right-clicking the Thread Group and choosing Add -> Listener -> Summary Report

4. Fill filename as output with destination where you will save your report with <filename>.jtl

5. Click run with green button at header menu at JMeter

6. Open text editor and write at cmd with destination that jmeter exist the reference code can be seen from this picture below after that the result can be seen from picture below

References

Binar Academy

--

--