Home > jmeter > JMeter 101: Write your first load test script

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.

Add Thread Group

Add Thread Group

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

Add HTTP Request

Add HTTP Request

http-request2

  • 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

Add Listener

Add Listener

  • Listener > Aggregate Report
  • Listener > View Result Tree

5. Save your script with .jmx extension

6. Go to Run > Start (ctrl + R)

Advertisements
  1. shivram
    October 18, 2010 at 8:00 pm

    the url remains the same before and after login.
    but the data on both these pages is different.
    how can i record both these pages using jmeter

  2. October 20, 2010 at 12:11 pm

    hi stomar,

    i suggest you record using HTTP proxy server, in that way Jmeter will automatically record all actions including urls and page elements that you executed in your application.
    you can check this post https://girliemangalo.wordpress.com/2009/03/18/jmeter-101-using-http-proxy-to-record-your-test/

    thanks,
    girlie

  3. Dzmitry Kashlach
    September 12, 2012 at 3:41 pm

    Thank you for material! Another set of JMeter tutorials is available via link from below:
    http://blazemeter.com/blog
    http://community.blazemeter.com/knowledgebase/topics/10018-jmeter-tutorials

  4. bhavya
    February 19, 2013 at 7:32 pm

    I am using jmeter in gui mode and i am not able to record the scripts using http proxy server.please help me

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: