? QA Design Gurus: REST APIs Performance Testing using JMeter

Oct 17, 2015

REST APIs Performance Testing using JMeter


JMeter allows us to test performance of both static and dynamic resources (web services like SOAP and REST APIs).
In this post, we will provide steps to test the performance of REST APIs

Installing and Running JMeter:

  • Download the JMeter apache-jmeter-2.13.zip from http://jmeter.apache.org/download_jmeter.cgi
  • Extract to any directory location (Ex: C:\). Note: Make sure that Java 6 or later version should be available)
  • Go to JMeter installation location -> bin directory and start 'jmeter.bat' file
  • Observe that JMeter user interface will launched successfully

Steps to write JMeter script for REST API test:


  • The first step is to create a Thread Group under Test Plan.
  • Thread Group is a placeholder for all other elements like Samplers, Controllers, and Listeners. We need one so we can configure number of users to simulate.
  • Right click on Test Plan -> Add -> Threads (Users) -> Thread Group. Name it.It has the options to provide 'Number of Users', 'Ramp-Up Time' and 'Loop Count'. Right now, provided 1 for all fields as shown in below image


  • Right click on Thread Group -> Add -> Sampler -> HTTP Request and provide server name, port number, path and add parameters. Save it. Note: Make sure that the server which you provided is up and running.


  • Add 'View Results Tree' to check the request status.Save it.

  • Click on Run icon to run the script.
  • Observe that script get executed successfully and you can see the results in View Results Tree window.

  • We are able to run one REST API method successfully for one time. As specified above, you could run this script many number of times/forever by specifying the 'Loop Count' in Thread Group.

1 comment:

  1. Hi! Thanks for sharing your thoughts. Well, the automated testing tools actually save your time and energy. The testing tools will do the work for them when it comes to the testing process so that they can do other work as well.Performance testing services is a highly specialized field of testing.

    ReplyDelete