Quick start : Apache JMeter

 

What is JMeter?

 JMeter is an Apache Jakarta project that can be used as a load testing tool for analyzing and measuring the performance of a variety of services, with a focus on web applications.

Installation

Please refer to http://jakarta.apache.org/JMeter/ download latest stable version and install.

Scope of this document

Scope of this document is only to give a quick start for how to use JMeter, for detailed information please refer to user manual  http://jakarta.apache.org/jmeter/usermanual/index.html

Quick Start

  1. Start JMeter (for windows <JMETER_HOME>/bin/jmeter.bat for linux  its  <JMETER_HOME>/bin/jmeter )
  2. Add a proxy
  3. a)      Right click Workbench -> add -> Non-Test Elements → HTTP Proxy Server.

    b)      Change the port accordingly in HTTP Proxy Server.

    c)      In URL patterns to exclude in  HTTP Proxy Server add the following

    .*\.jpg

    .*\.png

    .*\.gif

    .*\.css

  4. Add a thread group
  5. (a)    Right click Test Plan → add → Thread group

    You can rename the thread group

    (b)   Right click Thread group → add → Config element → Http Cookie Manger

    Set Cookie policy to compatibility

    (c)    Right click Thread group → add → Logic Controller → Simple Controller

    You can rename the Simple Controller

  6. Go to Internet Explorer Tools → Internet Options → Connections → LAN Settings
  7. Enable proxy server option and configure the port and IP as localhost which is configured in HTTP Proxy Server

  8. Go to Proxy server
  9. Select Correct target controller ( eg : Thread Group → Simple Controller)

    (d)   Start proxy

  10. Start Internet Explorer
  11. Enter the web application address (eg: http://10.11.12.14:8080/test-site ) in the internet explorer address bar and do all the steps that you want to perform.

  12. Stop HTTP Proxy
  13. All the steps and actions you have performed in the Internet explorer will be stored under target controller. (eg : Test Plan →  Thread Group → Simple Controller)

  14. If you want to run multiple scenarios in parallel, add multiple thread groups and repeat from step 3.
  15. You can add different listeners to views the statistics of test plan.
  16. Eg: Right click Test Plan →  add → Listener → Summary Report

  17. Save the Test Plan
  18. If you are planning to run the recorded script for a different web server then do the following
  19. (a)    Open the saved JMeter script in a text editor.

    (b)   Suppose the web address you have used for recording the script was  http://10.11.12.14:8080/test-site  and you want to change IP to 10.11.12.13 and port to 9999.

    (c)    search 10.11.12.14 in the text editor and replace with 10.11.12.13 Search 8080 in the text editor and replace with 9999 Save the plan

  20. If you want to run the JMeter script from a different machine then do the following
  21. (a)    suppose the test plan recorded machine is 10.2.3.4 and you want to run jmenter script from 10.2.3.5

    (b)   Transfer the JMeter script (test plan) to 10.2.3.5

  22.  Start JMeter
  23. Open test script and click run from the menu bar.
  24.  

    Reference

     

    [1] JMeter User Manual http://jakarta.apache.org/jmeter/usermanual/index.html

Leave a Reply