Wednesday, 29 January 2020

Jmeter Configuration Elements

In this post we will learn about few of the most commonly used configuration elements.

Video Tutorial -


 

HTTP Request Defaults -

For each HTTP request samplers which we mention in the test script there are chances that some fields like protocol and server IP is common for all the requests. In this case instead of mentioning the same in all HTTP Requests we can define this in HTTP Request Default.




HTTP Header Manager -

This element lets you add or override HTTP Request header. The headers specified here will be added for all samplers under its scope.Add the header as given below and this header is applicable for all the samplers under its scope.




 HTTP Cache Manager -

Web driver uses caching to reduce traffic over internet by storing the resources for subsequent runs.To mimic this behavior we can use HTTP cache manager .First time when we hit the url jmeter script store the resource file. The file contains last modified date and time information on the basis of which  cache manager checks weather the resources are updated or not and if the resources are updated then it downloads the updated resource file.
      If Clear cache option is checked then after each iteration cache will be cleared. By default 5000 elements are stored in cache. If Use Cache control option is checked  and if the request is GET request and timestamp is in future, then the sampler returns response from the cache. 

 


HTTP Cookie Manager -

Many web applications store some information as cookie and this jmeter element is used to store the cookies and use the information later during test runs. Each jmeter thread contains cookie storage space, if we are testing application where cookie is sued for storing information for perticular sessions then each jmeter thread will have its own session.
        Cookies can be added manually as shown in below figure which are called as user defined cookies. If clear cookies on each iteration option is checked then for each iteration cookies will be removed.

 







4 comments: