How to record script in Apache Jmeter

Welcome to Apache JMeter tutorials ,in this post you will learn How to record script in Apache Jmeter for web applications for AUT.When i am working with Apache Jmeter it is very easy and some what touch regarding preparing the scripts.As per my real time experience I am giving details How to record script in Apache Jmeter for web applications.Please follow below easy steps to record script in Apache Jmeter.

Steps to Record script in JMeter


1.Install Apache Jmeter from Apache Software site.
2.Download from Binaries as Zip/tgz format.
3.Unzip the file.
4.It will download apache JMeter 3.0 with different folders,here I am using Apache JMeter3.0 version.
How to record script in Apache Jmeter
Apache Jmeter

5.Now in case you are using Windows platform please open Apache Jmeter as jmeter.bat file from F:\apache-jmeter-3.0\bin path as below.
How to record script in Apache Jmeter
Open APACHE JMeter

6.Before recording the script please read below important steps to record script correctly.


Below are the components we are going to use,those are

1.Thread Group.
2.HTTP Request Defaults.
3.Recording Controller.
4.HTTP(S) Test Script Recorder.
5.View Results Tree.

7.Please add Thread Group in Test Plan ,Right click on Test Plan-Add - Threads(Users) - Thread Group.
How to record script in Apache Jmeter
Add THRED GROUP

8.Now add HTTP Request Default from Right click on Thread Group - Add - Config Elements - HTTP Request Default.In HTTP Request Default please add below details.
How to record script in Apache Jmeter
ADD HTTP REQUEST DEFAULT


Server Name or IP  - Ex: softwaretestutorials.blogspot.in ,you can add your QA/Dev server ip
Port - for my site not required and in your testing environment server will have port number ex: 8080,That's it.

9.Now Add Recording Controller why because all recorded html/.net any pages will add under Recording Controller component from Right Click on Thread Group - Add - Logic Controller - Recording Controller.
How to record script in Apache Jmeter
Add Recording Controller

10.Under Workbench please add HTTP(S) Test Script Recorder which is useful in recording the scripts from Right click on WorkBench - Add - Non Test Elements - HTTP(S) Test Script Recorder.
In HTTP(S) Test Script Recorder you have to provide Port number which is not using ,suppose you are using 8080 in your applications then you can give other than 8080 ex:8088  ,this ip should be configured in Proxy set up in browser then only your script will record properly.
How to record script in Apache Jmeter
HTTP Test Script Recorder


In HTTP(S) Test Script Recorder below details should be add,those are

1.Port
2.URL Patterns to include - Pattern will be .*\.html in case you want to record particular html extension pages.
3.URL Patterns to Exclude - Patterns will be (?i).*\.(bmp|css|js|gif|ico|jpe?g|png|swf|woff) ,this is default.
HTTP Test Script Recorder patterns


10.Now click on Start button in HTTP(S) Test Script Recorder,it will now generate ROOTCACertificate in F:\apache-jmeter-3.0\bin folder just you need to install this one in your browser Ex:Firefox Browser.
11.Click on Ok button.
12.Set up Proxy configuration in Firefox Browser as mention above below 6th step,otherwise your jmeter script will not record.
13.Open Firefox browser enter softwaretestutorials.blogspot.in hit enter.
14.Click on Some pages
15.Now check the Recording Controller ,it will automatically display recorded html pages under Recording Controller.
16.You will see the HTTP request details as below under Recording Controller.
How to record script in Apache Jmeter


What have you learned?


1.How to set up proxy in Jmeter
2.What are the components required for Recording.
3.How to record the script in Jmeter.

Comments

  1. Thank you for information but while recording in my company network ,not able to record the http samplers and samplers are not generating in J Meter Test Plan.Please help how to record with network proxy.

    ReplyDelete
  2. Hi, I getting too many requests generated even though i have excluded the suggestion. Please help me out

    ReplyDelete

Post a Comment