In the last article, we discussed about hands on with Apache JMeter. Now most of the testers might be thinking about what’s next after installation, understanding the tool and how about recording a test script using JMeter.
In today’s article we will see how to record your first JMeter Test script using JMeter HTTP Proxy Server, How to do Firefox browser settings for recording JMeter first test plan, How to do JMeter load testing tool settings for recording your first test plan.
Recording using Apache JMeter HTTP(s) Proxy Server
The HTTP(S) Proxy Server allows JMeter to intercept and record your actions while you browse your web application with your normal browser. JMeter will create test sample objects and store them directly into your test plan.
First we have to setup proxy server in Firefox browser to checkout the First Test plan recording steps. Follow simple steps:
- Open Firefox Browser
- Click on Tools > Options > Advanced tab > Network Tab > Setting button.
- Choose “Manual proxy configuration” radio button.
- Enter HTTP Proxy: localhost
- Enter Port: 8080 (Make sure that JMeter proxy server port number and local proxy server port number are same )
You can check following image to get exact steps for how to setup proxy server.
Once the above setting is done open JMeter tool to set up recording for your first Test Plan.
1) To learn how to start JMeter you can check this post. Now open the JMeter by clicking on JMeter.bat file.
2) Right click on Test Plan and choose Add > Threads (Users) > Thread Group.
- The new Thread Group element will be added under Test Plan. Read about Thread Group here.
3) Right click on Thread Group and choose Logic Controller > Simple Controller. The new Simple Controller option will get added under Thread Group element.
4) Right click on Workbench and choose Add > Non-Test Elements > HTTP Proxy Server.
The new HTTP Proxy Server option will get added under Workbench element. This option will add JMeter proxy server in your JMeter test plan.
5) Before start recording we have to do simple configuration setting in the HTTP Proxy Server option
- Click on HTTP Proxy Server option
- Under Global Setting section – Set Port: 8080 (Same port value which is configured in the above steps while configuring setting FireFox browser)
- Under Test Plan Content section – Choose Target Controller: Thread Group > Simple Controller.
Once you complete your settings then JMeter HTTP Proxy Server will look like as below:
Now you are ready to start Recording using HTTP Proxy Server in JMeter & record your first JMeter test plan script in Apache JMeter. Click on “Start” button & open the URL in FireFox browser for which you want to run your performance testing script. Perform required navigation in FireFox browser & all steps will be recorded in Apache JMeter. (Note: Don’t do unnecessary navigation while recording, if you did that then please remove recorded script & start again from scratch.)
The recorded script will be displayed under Thread group > Simple Controller option same as displayed in below image. You should also explore the recorded script for your understanding how JMeter recording works using proxy server.
If you enjoy reading article then you can subscribe our updates for FREE, just add your email id . I will keep on updating the article for latest testing information. Subscribe and stay tuned for updates, there’s lot more to come.
🙂 Happy Performance Testing !!!