April 21, 2020
Estimated Post Reading Time ~ 2 mins

HTTP Proxy Server in JMeter: Record Example Script-chapter 11

Record Testing help tester to record & run their activity against test target. It is a type of automated testing but for multiple users. This tutorial guides you how to use Proxy Server to record your test.

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

In this tutorial, you will learn
Step 1) Setting HTTP Proxy server
Step 2) Record your activity
Step 3) Run your Test Plan
Step 4) Save your test result

Here is the roadmap of this practical example
040415_0501_HowToUseJme1
Step 1) Setting the HTTP Proxy server
This is a step-by-step guide to setup proxy
Start JMeter
Select Test Plan on the tree
Add Thread Group
Right click on the Test Plan and add a new thread group: Add => Threads (Users) =>Thread Group
040415_0501_HowToUseJme2
Add HTTP Request
Select the Thread Group; right click Add => Config Element => HTTP Request Defaults
040415_0501_HowToUseJme3
In new HTTP Request Defaults element: In Server name or IP, enter "google.com". You should keep the others fields blank

040415_0501_HowToUseJme4
Add Recording Controller
Right click on the "Thread Group" and add a recording controller: Add => Logic Controller =>
Recording Controller
040415_0501_HowToUseJme5
Add Proxy Server to WorkBench
Right click on the Workbench and add the http proxy: Add => Non-Test Elements => HTTP Proxy Server
040415_0501_HowToUseJme6
Set Target Controller where your recorded scripts will be added
040415_0501_HowToUseJme7

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

Start your Browser choose Tool => Option => Advanced => Network => Setting => Enter HTTP proxy as figure below
040415_0501_HowToUseJme9

Step 2) Record your activity
Now Launch http://www.google.com in your web browser (JMeter still open)
Do activities search the keyword "apache".
Back to JMeter, in HTTP Proxy Server, click Stop when finished

After finishing recording, you will see JMeter automatically created a new HTTP request as the figure below
040415_0501_HowToUseJme11
JMeter has already recorded a user request to the 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
Click File => Save your Test Plan as
040415_0501_HowToUseJme12
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
040415_0501_HowToUseJme13

Step 3) Run your Test Plan
Select Thread Group => Add => Listener=> Summary Report

040415_0501_HowToUseJme14

The Summary Report will show some basic statics
040415_0501_HowToUseJme15

Select Thread Group, enter information as the figure below
040415_0501_HowToUseJme16

Before you start the test, select "Summary Report". When you ready to run a 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.
040415_0501_HowToUseJme17

Step 4) Save your test result
Click Save Table Data to save test result to file
040415_0501_HowToUseJme18
Enter the name of the test result and click Save. Test Result in JMeter is saved in *.csv format as default
040415_0501_HowToUseJme19
aem4beginner.blogspot


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.

Ad Blocker Detected :(

Please consider supporting us by disabling your ad blocker.

Please Disable your adblocker and Refresh the page to view the site content.