JMeter 101: Write your first load test script
Going through this session, assumes that you have successfully set-up JMeter distribution(latest version is 2.3.2) in your box, but if not, it’s never too late you can still check it out on my previous post – JMeter 101: Introduction.
Using the friendly GUI of Jmeter, lemme me help you explore and write your first load test script.
1. Go to “bin” folder of your JMeter distribution, double click “jmeter.bat” file
2. Simulate users by adding a Thread Group.
- Set Number of threads(users) = 5, => the number of concurrent users we want to simulate
- Set Ramp-up Period(in seconds) = 10, => the amount of time it will take to create the threads/users
In this example, Jmeter will create a thread every 2 seconds (10/5). If ramp-up period is set to “0″ or blank, Jmeter will create all the threads immediately.
- Set Loop count = 1, => the number of times to execute the test
3. Simulate web requests by adding Sampler > HTTP Request
- Set a descriptive HTTP request name
- Set Server name or IP = http://www.yahoo.com
- Set Path = “/”, which is Yahoo Homepage
4. To help us analyze the results, add the following listeners
- Listener > Aggregate Report
- Listener > View Result Tree
5. Save your script with .jmx extension
6. Go to Run > Start (ctrl + R)