SUBSCRIBE HERE TO GET POST UPDATES VIA EMAIL :

Delivered by FeedBurner

JMeter - HTTP Request Defaults Config Element

HTTP Request Defaults is one of the jmeter configuration element. You can set default values for HTTP Request controllers using HTTP Request Defaults in your software load test plan. Let's say, You have software load test plan with 10 HTTP requests and all requests are being sent to same server. In this case, You can add HTTP Request Defaults and set server name in Server Name or IP field of HTTP Request Defaults. Then you do not need to set Server Name or IP in all 10 HTTP requests. HTTP requests will inherit Server Name or IP field's value from HTTP Request Defaults. Let's see how it works with practical example.

Add HTTP Request Defaults In Software Load Test Plan
You can add HTTP Request Defaults parallel to request or controller. For adding HTTP Request Defaults under Thread group,
  • Right click on Thread Group -> Add -> Select Config Element -> HTTP Request Defaults. See bellow given image.

It will add HTTP Request Defaults under Thread Group.

Example : Using HTTP Request Defaults In Jmeter Software Load Test Plan
I have prepared sample jmeter software load test plan to show you how HTTP Request Defaults actually works and when to use it.

I have test plan with 3 HTTP requests(/index.html, /site/contact.html and /site/guidelines.html) and all 3 requests are being sent to same server jakarta.apache.org. So i will add HTTP Request Defaults in my test plan and set Server Name or IP = jakarta.apache.org as shown in bellow image.


Now in all three HTTP requests, I need to set only remaining path. Server name will be automatically inherited from HTTP Request Defaults in all three HTTP requests as shown in bellow image.


You can see that i have not set server name in any of the request. So server name will be inherited automatically from HTTP Request Defaults when you run test and create full URL of page. See result bellow.


All three requests are pass. Also you can see that it hahs created full URL(Server name + Path) of index page.

This way you can use HTTP Request Defaults in your software load test plan.
<< PREVIOUS || NEXT >>

No comments:

Post a Comment