JMeter Hello World – Submit Form

I used JMeter recently to generate load on a webapp for debugging a production issue. Below is a simple step-by-step details for submitting a form using JMeter

  1. Start JMeter
  2. Add Thread Group

     

  3. Define thread group properties.
    • Generate 50 current requests
    • Start with one request initially, generate two requests after two seconds from start time, generate three requests after four seconds from start time, etc.
    • Repeat for1000 iterations

     

  4. Add HTTP Request Sampler
  5. Define HTTP Request properties
    • Define the server name (localhost in screenshot below)
    • Define port number (8080)
    • Define path — relative path (/signup.do)
    • Change the method to “POST”
    • Add form fields (name and password)
  6. Add listener “Save responses to a file”
  7. Define response file location
  8. Start the test by selecting “Start” from “Run” menu

NOTE: listener “Save Responses to a file” can be disabled by right clicking on the item and selecting “Disable”. For my test, I enabled this with thread and user count 1, ran the test and verified the response. Once everything is working as expected, I disabled it and generated load by increasing the thread and loop count.

Advertisements