Showing posts with label performance. Show all posts
Showing posts with label performance. Show all posts

Wednesday, January 1, 2014

Jmeter : Easy Configuration

Jmeter : Easy Configuration

Open Jmeter :

  1. Make sure Jmeter is downloaded and JDK is configured in your system(Follow the link below:
  2. Goto folder where Jmeter is extracted. > Bin .
  3. Double click on Jmeterw.cmd (for windows ) , jmeter.sh (for Linux) 
  4. Optional : terminal > sh jmeter.sh

REST applications :

  1. Rt Click on Testplan > Add---> Thread Users ---> Thread Group.
  2. Thread Group >
    1. rt ck >Add >  Sampler> http request 
      1. name: any name
      2. Server : endpoint only
      3. port : port only
      4. request type : Eg- POST
      5. path : resource
      6. body Data: json
    2. rt ck > Add > Config > http Header Manager
      1. Add
      2. Name=Contenty-Type , Value= application/json
    3. rt ck > Add > Assertions >  Response Assertions
      1. Fields to Test = Response Code
      2. Patterns to Test > Add > 200
    4. rt ck > Add > Listener
      1. Summary Report >filename > path/summary.csv 
      2. Results Table >filename >  path/table.csv
      3. Results Tree
      4. Response Time 
      5. Aggregate Time >filename >  path/aggregate.csv
  3. Run the setup
    1. summary report , aggregate Graph  > ck on Save Table Data button
  4. You can also co to thread group add 
    1. Change Number of Threads
    2. Rampup period [Optional]

Performance parameters :

  • Results Table

    1. ThreadName = loopnumber - ThreadNumber
    2. Label :Request Name
    3. Sample Time : Request+Response
    4. Status : Assertions Pass or Fail
    5. Bytes : Bytes Received by Jmeter
    6. Sent Bytes : Bytes Sent To server
    7. Latency : Time Jmeter needs to wait after sending request till the response is received

  • Aggregate Graph

    1. Samples : Number for Requests 
    2. Averge : Average time request+Response
    3. Median
    4. 90% Line : Req + Response time for 90% of samples
    5. 95 % line : Req + Response time for 95% of samples
    6. 99% line : Req + Response time for 99% of samples
    7. Min : least Req+Response time 
    8. Max : highest Req+Response time 
    9. Error : Assertion Fails
    10. Throughput : number for requests made per second  by Jmeter

Performance Testing for UI testing Applications : 

Once Jmeter is opened 

  1. Rt Click on Testplan > Add---> Thread Users ---> Thread Group.
  2. Rt Click on Thread Group > Add --- > Logic Controller ---- >click on recording Controller
  3. Rt Click on Thread Group > Add --- >Config Controller --- >click on Http Cookie Manager
  4. Rt Click on Thread Group > Add --- >Config Controller --- >click on Http Request Defaults 
  5. Rt Click On work bench > Add --- > Non test Elemenets --- > click on  Http Test Script Recorder. 
  6.  Http Test Script Recorder >Port ="8080"


  1. Click On Http Request Defaults >Server name "http://in.yahoo.com/"
  2. Click on  Http Test Script Recorder > Https Domain "http://in.yahoo.com/"
    1. Http Sample Settings >Type > HttpClient4
    2. Url pattern to exclude > Click on add suggested excluded

  1. Open FireFox Browser.
  2. Goto Tools >options >Advanced >network>Click on Settings .
  3. Select Manual Configuration : Http Proxy ="localhost"    and port="8080"
  4. Click on OK



Now the Jmeter and Browser is Configured 

  1. Open Jmeter> Goto Https Test Script Recorder >Click on Start button.
  2. Open FireFox.
  3. Paste URL "http://in.yahoo.com/"
  4. Do any operations on the webpage .


You will see the transaction getting recorded.

Note :
While playing the recorded script make sure you add a "View Results Tree" Element to your Testplan not to your workbench.




If you do not see any recording please see the detail installation below :