2013-01-31

What is HTTP Request Defaults? Why we use it

In this following article we are going to see what is HTTP Request Defaults in JMeter and why we use it.

HTTP Request Defaults is the default configuration set for each http request in a fragment/thread/plan which are under it. This is one king of Configuration element that controls the HTTP Request .

When we add a  HTTP Request Defaults(Thread group->(right click)add->Config Element-> HTTP Request Defaults) we will find these

Server:Domain name /IP of server [Exclude http:// prefix]
Port: Port of server.
Connect Timeout(ms): Time to wait for a connection to open
Response Timeout(ms):Time to wait for a response.
Implementation:Java/HttpClient3.1/HttpClient4.[If blank, the default will be activated that is in jmeter.properties.]
Protocol :HTTP/HTTPS
Path: The path to resource.
[Note:Path is the default for the full path, not a prefix to be applied to paths specified on the HTTP Request screens.
Send Parameters With the Request -The query string will be generated from Name and Value.The query string will be generated depending on the choice of "Method"(In the http request sampler)
[If we send a file by multipart form, it will be created using the multipart form specification].
Press Add to add row for parameter.  We can enable encoding if we need(spatially for https)
Server (proxy): Hostname/IP [Exclude http:// prefix.]   
Port: Proxy Port
UserName/Password for Proxy
Retrieve All Embedded Resources from HTML Files: Enabling this, Jmeter will parse the HTML file and send HTTP/HTTPS requests for all images/Java applets/JavaScript /CSS etc
Use concurrent pool: Use concurrent connections to get embedded resources.
Size(byte):Pool size for concurrent connection
Embedded URLs must match: Filter option(Perl regular expression)

Why we use HTTP Request Defaults?
1. When we need to categorize http request under single configuration
2. When we need to use a configuration for multiple fragment( test request segments)
3. When we need to dedicate a particular sampler set following a specific http/https request settings.

-It is best practice to use HTTP Request Defaults in test planning so that we can track the configurations and requests easily.

...Thanks....:)

1 comment:

  1. I wish I can see some SCREEN SHOTS also

    ReplyDelete