2 Minutes To Code (β Version)

JMeter - 2 minute tutorial

Usage of HTTP Sampler for a basic http test

Let's write our first web test plan for testing an http url. So here are the steps. The screenshots are provided below.

The steps are as follows:
  1. Right click on Test Plan in left-hand side pane. And add a thread group. In the right-hand side pane, set a name for thread-group (eg. First Thread). Keep default values in other fields. There is no save or update button. Any changes you make are instantly applied when you move away from the eleent.
    [Image 1 and Image 2]

  2. Now, right-click on the thread-group created above, and add Sampler HTTP Request. In the the right-hand pane, add a name for the sampler (eg. Home Request), in the Server name or IP field add your webserver's hostname or IP Address. In the Path field, add the path of your servlet, jsp or html file that you want to test. Let other fields keep the default values.
    [Image 3 and Image 4]

  3. Now in order to view the test results, you need a Listener. We will use a tabular listener. Right click on Test Plan and add Listener View Results in Table. Give it a name and let other fields keep default value.
    [Image 5 and Image 6]

  4. You are done now. Just hit the start button (green arrow head) from the menu bar. In the View Results in Table page, the result will be displayed. It will contain timestamp, response time, response size in bytes etc.
    [Image 7]

Image 1 : Add a thread-group. Top of page


Image 2 : Give a name to thread-group. Top of page


Image 3 : Add an HTTP Request Sampler Top of page


Image 4 : Give a name to HTTP Sampler, add hostname and webpage path. Top of page


Image 5 : Add the listener "View Results in Table" Top of page


Image 6 : Give a name to listener and run the test. Top of page


Image 7 : Check result of test. Top of page