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.
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.
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.
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.
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.
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.
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.
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.