This time on Enfew.com we are publishing the tutorial for JMeter – one of most popular testing tools for online websites and ecommerce sites. In this tutorial you will learn how to record the testing plan and export it for the future use.

Many thanks to our friends from Guru99.com for submitting and sharing this tutorial with our blog readers.

Recording of the testing

Test recording helps to record & re run testing activity against the test targets. It is a type of automated testing but for multiple users.  This post guides you how to use Proxy Server in order to record your test.

The Proxy Server allows JMeter to watch and record user activity while they are browsing web application with normal browser.

Here is the roadmap of this practical example

Jmeter testing roadmap

Step 1) Setting HTTP Proxy server

This is Step-by-step guide to setup proxy

  1. Start JMeter
  2. Select Test Plan on the tree
  3. Add Thread Group

Right click on the Test Plan and add a new thread group: Add ? Threads (Users) ?Thread Group

Jmeter add thread group

  1. Add HTTP Request

Select the Thread Group; right click Add ? Config Element ? HTTP Request Defaults

JMeter add request defaults

In new HTTP Request Defaults element: In Server name or IP, enter “google.com”. You should keep the others fields blank

JMeter add http request details

  1. Add Recording Controller

Right click on the “Thread Group” and add a recording controller: Add ? Logic Controller ?

Recording Controller

JMeter add recording controller

  1. Add Proxy Server to WorkBench

Right click on the Workbench and add the http proxy: Add ? Non-Test Elements ? HTTP Proxy Server

JMeter add proxy server

  1. Set Target Controller where your recorded scripts will be added

Jmeter set target controller

  1. Start Proxy Server

Return to HTTP Proxy Server, and click the Start button at the bottom. Now your JMeter proxy server start

JMeter start proxy server

  1. Start your Browser (I used Firefox), choose Tool ? Option ? Advanced ? Network ? Setting ? Enter HTTP proxy as figure below

Set proxy configuration in the browser

 

Step 2) Record your activity

  1. Now Launch http://www.google.com in your web browser (JMeter still open)
  2. Do activities search the keyword “guru99“.
  3. Back to JMeter, in HTTP Proxy Server, click Stop when finished
  1. After finishing recording, you will see JMeter automatically created a new HTTP request as figure below

JMeter request records

 

JMeter has already recorded a user request to Home Page of Google website. Http://www.google.com/

The other HTTP requests display in above figure, you should remove them. Because, sometime JMeter also records some advertising links while you are searching keyword on Google. We should ignore them in our Test Plan

  1. Click File ? Save your Test Plan as

JMeter save your test plan

  1. A Dialog box display ?  enter a name of your test plan at File Name field ? Click Save

Now your Test Plan is saved under name RecordingTestPlan.jmx

Step 3) Run your Test Plan

  1. Select Thread Group ?  Add ?  Listener?  Summary Report

JMeter run your recorded test plan

  1. The Summary Report will show some basic statics

JMeter summary report

  1. Select Thread Group, enter information as figure below

JMeter thread group configuration

  1. Before you start the test, select “Summary Report”. When you ready to run test, select Run ? Start (Ctrl+R). JMeter will playback your activity in 100 times

As the test runs, the statistics will change until the test is done.

JMeter test result summary report

Step 4) Save your test result

  1. Click Save Table Data to save test result to file

JMeter save summary result report

  1. Enter the name of test result and click Save. Test Result in JMeter is saved in *.csv format as default

Troubleshooting

If you face the issue while running the above scenario … do the following

  1. Check whether you are connecting to internet via a proxy. If yes, remove the proxy.
  2. Open a new instance of Jmeter
  3. Open the RecordingTestPlan.jmx in Jmeter
  4. Right Click on Workbench ?  Merge? Select HTTP Proxy Server.jmx
  5. Click on Thread Group ? Summary Report
  6. Run the Test

Leave a Reply

Your email address will not be published.