Skip to content

Example of performance testing using jmeter. Practice Different type of websites load, spike , volume testing and show their report in html view

Notifications You must be signed in to change notification settings

radwanSQA/Performance-Testing--JMeter

Repository files navigation

What Is Performance Testing ?

Performance Testing is a software testing process used for testing the speed, response time,stability,reliability,scalability and resources usages of software application under particular workload.Performance testing also known as a perf testing.

Speed - How much time to need application responds quickly
Scalability - Maximum user load the software application can handle
Stability - Is application stable under varying loads

Types of performance testing

  • Load Testing
    Check the application ability to perform on normal and peak usage.
  • Stress Testing
    Stress testing has an incremental approach where the load is increased gradually.
  • Volume Testing
    Under the volume testing large no. of data is populated in a database and the overall software system behavior is monitored.
  • Capacity Testing
    Capacity Testing is used to determine how many users and/or transactions a given web application will support and still meet performance. During this testing, resources such as processor capacity, network bandwidth, memory usage, disk capacity, etc. are considered and altered to meet the goal.
  • Reliability/Recovery
    Reliability Testing or Recovery Testing - is to verify whether or not the application is able to return back to its normal state after a failure or abnormal behavior and how long does it take for it to do so (in other words, time estimation).
  • Scalability Testing
    The objective of scalability testing is to determine the software application’s effectiveness in “scaling up” to support an increase in user load. It helps plan capacity additions to your software system.

What Is JMeter?

JMeter is a powerful automated testing tool with enormous testing capabilities. It is a Java desktop application and the GUI uses the Swing graphical API

Why Do We Use JMeter?

It helps to measure and analyze the performance of web applications and other variety of services.

Installation of JMeter

Before Installing JMeter you need to install java on your device. To verify the version of java which version is installed
Go to CMD and write this command

java -version

Then open https://jmeter.apache.org/download_jmeter.cgi.

Select a .zip file and download the JMeter file
Unzip the folder to your computer
Go to Bin folder inside your JMeter folder and launch the .bat file

After click bat file wait few seconds jmeter UI will be show

Note: Make sure that you do not close the .exe file as that will also close JMeter UI.

JMeter from command Line

Why use the command line ?

  • GUI consumes memory, slower the process
  • integrate with any external process CI CD

How is the process?

Step 1: go to JMeter bin folder

Step 2: go to the folder address bar, write cmd then enter.you see command window

Step 3:run the command like below

jmeter -n -t “location of your test file” -l “location of results file”

-n == non gui mode
-t == your test file
-l == your location result

Create report end of the test
Open cmd line go to jmeter bin folder go to cmd. write below command

jmeter -n -t “location of your test file” -l “location of results file”  -e  -o “location of report folder”

Example: jmeter -n -t "fake-rest-api\FakeRestAPI.jmx" -l "fake-rest-api\FakeRestAPI.jtl" -e -o "fake-rest-api\FakeRestAPI"

Create report from standalone csv file

jmeter -g “location of results file”  -o “location of report folder”

How to use blazemeter to record JMeter test

  • Create blazemeter account
  • Login to blazemeter
  • Get blazemeter account
  • Add chrome extension
  • Record test
    Go to the website you want testing and Click start on blazemeter. Visit a different link or menu you want to pf testing.
  • Save jmx
    Stop and save jmx file from blazemeter.After save got tot jamter and run the file

How to get data from csv file

  • Add CSV data set from config
Test Plan-> Config Element -> CSV data set Config
  • Create a csv file and add data
  • Refer the csv file in JMeter csv data set config
  • Refers values from csv file using syntax ${variableName}
  • Run and validate