How To Import HTTP Request Quickly Using Curl Utility In JMeter



Problem Statement

For web applications, sometimes we observe that JMeter is not able to capture all the HTTP requests that can be seen in the web browser developer’s tool. To add those requests in JMeter script we need to add http request sampler in the script as follows:
  • Add → Sampler → HTTP Request
  • Set the path and fill all the required fields  
  • Add header manager (include parameter name and its value)

However, all these steps are time consuming and can also lead to human errors

New Feature in Jmeter 5.1

To overcome above issue, in the latest update of JMeter 5.1 apache has introduced a new feature which helps to add the request with the help of Chrome Dev tool and Import from cURL(alpha) utility. Now with the help of this utility we can directly add a missing request to our script in less span of time.

Steps to add HTTP request quickly in Jmeter

Step1

In developer’s tools, click on “Copy as cURL (cmd)” as highlighted for the required HTTP request








Post recording of your script in JMeter, if you see any request that has been missed out with the help of dev tool, copy that request as cURL(cmd) / cURL(bash) any one of the two



Step2

In Jmeter, Click on Tools and select “Import from cURL (alpha)”





A text field is popped up on the screen, paste copied cURL from the browser here and click on Create HTTP request





Reference:






No comments

If you have any doubt or suggestion, please let me know

Powered by Blogger.