How to use the Recording Controller in Jmeter to record the test script

Using the JMeter HTTP(S) Test Script Recorder:

By using the Recording Controller we can easily record the website navigation script and use it for the load testing. Now we see that step by step how you can use it-

Step 1: Need below software

Apache JMeter – Download and run the .bat/.sh file from the bin folder. (.bat for window & .sh for Linux)

Java 6 or later – Download and proper installation of Java.

Mozilla Firefox – Download and proper installation of Mozilla.

Step 2: Run the .bat/.sh file from the bin folder.

Step 3: Now build a test plan

  • Add the Thread Group to Test Plan
    Right-click on Test Plan > Add > Threads (Users)

Test Plan 1

Add Thread Group 2

Number of Threads– Total number of users which we want to hit on the server.
For example: – here we will hit the 10 users at a time on the server.

Ramp-Up Period– Time given the next user to hit on the server.
For example: – Suppose we have 10 users (Number of Thread) and Ramp up period is 10. Then we are giving each user 1 second to hit the server.

Loop Count– We want to execute the same operation two times continuously then we need to increase the loop count as 1. It means 10 people will hit the server one time.

Add Thread Group 3

Step 4: Add the Recording Controller

  • Right-click on Thread Group > Add > Logic controller > Recording Controller

Recording Controller  4

Step 5: Add HTTP Request Defaults

  • Right Click on Workbench –> Add–> Config Elements –> HTTP Request Defaults
  • We are added the HTTP Request Defaults causes we will send the multiple request to the same web server.

Http Request default 5

HTTP Request Defaults contain the two important parts-

  1. Server Name or IP
  2. Port Number

Server Name or IP: Enter the url or IP address of the site on which you want to perform the load testing.

Port Number: Enter the default port number 8080.

Http Request default 6

Step 6: Add HTTP Test Script Recorder 

  • Right Click on Workbench–> Add–> Non-Test Elements –> HTTP Test Script Recorder.

Proxy server 7

Port: Fill the 9090 sometimes 8080 port is busy.

Target Controller:  Add the place where you want to record the script. Here we choose –use recording controller.

URL Pattern to Include/Exclude: When the page is loaded then images are loaded, some are restricted so allow the all. URL Patterns to Include”. This will create a blank entry.

Proxy server 8

Step 7: Setting of the browser proxy

  1. Open Firefox Browser.
  2. Click on Tools shown at the top menu.
  3. Click on Options shown under Tools
  4. Click on Network tab shown on the window after clicking Options.
  5. Click on Settings Button.

Mozila

Mozila 1

6. Click on Manual proxy configuration
7. Enter localhost and Port 9090.

Mozila 2

Mozila 3

8. Click ok button.

Step 8: Installation of the CA Certificate in the browser-

  • When you click on the start button on the HTTP(S) Test Script Recorder then the below screen is appeared-

Certificate 10

  • Click on the ok button.
  • Open the Mozilla Browser.
  • Go to the tools > Option > Advanced > encryption > View certificate

Certificate 11

  • Click on the view certificates then below screen appear-

Certificate 12

  • Click on the import button and go to the bin folder and install the CA certificate-

Certificate 13

  • View the certificate and select the check box and click on the ok button.
  • Click the all ok button.

Step 9: Now Record the Script

  •  Now enter the url in the browser and navigate the screen according you.
  • After completion the navigation stop the recording from the HTTP Test Script Recorder.

Step 10: Add the Listener

Listerner14

Step 11: Now save the Test Plan

Sve 15

Step 12: Now Run the Test Plan

Start run 16

Step 13: After completed the process check the result-

  •  Aggregate Graph

Aggregate Graph 17

  • Aggregate Report

Aggregate Report 18

  • Graph Result

Graph Results 19

  • Summary Report

Summary Report 20

*************************************E*N*D***********************************

Please share your views….

Advertisements

Record and Playback Feature by Using JMeter with Step by Step:

How To Use JMeter To Record Test Scenarios ? 

Record and Playback in JMeter- 

  • This is the very easy way to record the created test plan.

Step 1: Need below software

  • Apache JMeter – Download and run the .bat/.sh file from the bin folder.(.bat for window & .sh for Linux)
  • Java 6 or later – Download and proper installation of Java.
  • Mozilla Firefox – Download and proper installation of Mozilla.

Step 2: Run the .bat/.sh file from the bin folder.

Run file-1

 

Step 3: Now build a test plan

  • Add the Thread Group to Test Plan
    Right-click on Test Plan
    Mouse over Add >
    – Mouse over Threads (Users) >
    – Click on Thread Group

Thread Group -2

  • After adding the thread group it shows like as-

Thread Group -3

Number of Threads– Total number of users which we want to hit on the server.
For example: – here we will hit the 10 users at a time on the server.

Ramp-Up Period
– Time given the next user to hit on the server.
For example: – Suppose we have 10 users (Number of Thread) and Ramp up period is 10.
Then we are giving each user 1 second to hit the server.

Loop
 Count– We want to execute the same operation two times continuously then we need to increase the loop count as 2. It means 10 people will hit the server two times.

Thread Group -4

Step 4: Add HTTP Request Defaults

Right Click on WorkBench –> Add–> Config Elements –> HTTP Request Defaults

We are added the HTTP Request Defaults causes we will send the multiple request to the same web server.

Http Request default

 

  • After adding the page it looks as below-

Http Request default 1HTTP Request Defaults contain the three important parts-

  1. Server Name or IP
  2. Port Number
  3. Protocol

Server Name or IP: Enter the url or IP address of the site on which you want to perform the load testing.

Port Number: Enter the default port number 8080.

Protocol: we are sending the http request so enter the Http.

Http Request default 2

Step 5: Add HTTP Proxy Server

Right Click on Workbench–> Add–> Non-Test Elements –> HTTP Proxy Server.

  • It records the all action which we navigate into the browser.

Proxy

After adding it shows like as below- in the red portion shows the important points of this screen.

Proxy 1

Port: Fill the 9090 sometimes 8080 port is busy.

Target Controller:  Add the place where you want to record the script. Here we choose the thread group.

URL Pattern to Include/Exclude: When the page is loaded then images are loaded, some are restricted so allow the all.URL Patterns to Include”. This will create a blank entry.

Proxy 2

Step 6: Add the Listener

Right click on Thread Group–> Add –> Listener –> View Results Tree.

View result tree

Right click on WorkBench–> Add –> Listener –> View Results in Table.

View result in Table

Step 7: Setting of the browser proxy

  1. Open Firefox Browser.
  2. Click on Tools shown at the top menu.
  3. Click on Options shown under Tools
  4. Click on Network tab shown on the window after clicking Options.
  5. Click on Settings Button.

Mozila

 

Mozila 1

 

Mozila 2   6. Click on Manual proxy configuration
   7. Enter localhost and Port 9090.

Mozila 3

 8.Click ok button.

Step 8: Now Record the Script 

  • Enter the url in the browser, it gives the screen as given below-

Browser proxy

  • Now go the Http proxy server and click on the start button as showing in the bottom-

Start proxy server

  • Now enter the url in the browser and navigate the site as you want to record and test the load.
  • After complete the navigation go to the JMeter and click on the stop button from the http proxy server.
  • Now you can see the all navigation which you have done on the browser.

Navigation url

  • Add the Listener as you want-

Add lister after recording

  • Now click on the save button to save the recording.

Save the script

  • Now run the script.

Run the script

  • During the running process it looks like as-

Running the script

  • Wait until the running isn’t completed, when it is completed then green color is changed.

complete test run

Step 9: Now view of the Result-         

  •  View Result Tree

View Result Tree after completed

  • View Result in Table

View Result in Table after completed

  • Summary Report

Summary Report after completed

  • Aggregate Graph

Aggregate Graph after completed

  • Aggregate Report

aggregate report

  • Graph Result

Aggregate Report after completed

***********************************Completed********************************

 Please share your feedback….