Config Elements for JMeter

Requests sent to the server can be further parameterize using some config elements which are executed before the actual request. A simple example of it could be reading values of a variable from a CSV file for which CSV Data Set Config is used.

Below are some of the important config elements used in the performance testing of the web and mobile applications
  • CSV Data Set Config.
  • User Defined Variables
  • HTTPS Requests Default
  • HTTPS Cache Manager
  • HTTPS Cookie Manager

CSV Data Set Config

CSV data set config helps Jmeter in picking values of some parameters from a CSV file rather than passing different parameter in each separate request. For example, if we need to test login functionality with a different set of users and passwords, then we can create two columns in a CSV file and enter the values there so that JMeter can pick one for each request sent to the server.

Below is the flow of using CSV data set the config to test weather API for different cities in India.

  • Adding CSV data set config element to test plan
  • Creating CSV file
  • Passing variable in the request parameter. APPID parameter can be generated dynamically fromĀ http://openweathermap.org/appi
  • Running the test and viewing results.
User Defined Variables

It helps Jmeter to pick values from a pre-defined variable. For example, support that you need to create a test plan in which you need to add many HTTP requests on the same URL and there could be a scenario in which client plans to migrate it later to some different URL.So, to avoid updating URL in each request we can tell JMeter to pick the URL from a UDV (User Defined Variable) which can be later updated to handle all requests to updated URL.

So, to avoid updating URL in each request we can tell JMeter to pick the URL from a UDV (User Defined Variable) which can be later updated to handle all requests to updated URL.

HTTP Request Defaults

This config element is very useful for specifying the default values of https requests. To guide you more, take an example where we need to hit 50 different requests at google server.In this scenario, if we add an HTTP Request Default then we need not specify a server name, path or any other properties like port number, connection time out properties. Whatever is specified in the HTTP Request Default config element is inherited by all HTTP requests.

In this scenario, if we add an HTTP Request Default then we need not specify a server name, path or any other properties like port number, connection time out properties. Whatever is specified in the HTTP Request Default config element is inherited by all HTTP requests.

Please see below how to add HTTP Request Default and specify server and path.

HTTP Cache Manager and HTTP Cookie Manager are used in making JMeter behave as a real-time browser. HTTP Cache manager can clear cache after each request whereas the other one can manage the cookies settings.

Leave a Reply

Your email address will not be published. Required fields are marked *