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
- Start JMeter
- Add Thread Group
- 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
- Add HTTP Request Sampler
- 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)
- Add listener “Save responses to a file”
- Define response file location
- 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.