Configuration Element enable us to declare variables, so Samplers can use data through these variables. Configuration element is accessible from only inside the tree node where you defined it. Also, if a configuration element is defined inside a tree node, it will have high precedence than the same configuration element which is defined in a parent node.
List of available Configuration Elements is as follows:
- CSV Data Set Config
- DNS Cache Manager
- FTP Request Defaults
- HTTP Authorization Manager
- HTTP Cache Manager
- HTTP Cookie Manager
- HTTP Header Manager
- HTTP Request Defaults
- Java Request Defaults
- JDBC Connection Configuration
- Keystore Configuration
- LDAP Extended Request Defaults
- LDAP Request Defaults
- Login Config Element
- Random Variable
- Simple Config Element
- TCP Sampler Config
- User Defined Variables
Let’s discuss some important Configuration Elements:
1: CSV Data Set Config:
CSV Data Set Config element is used to read data from a text or CSV format file. For Example, If you need to perform load test of login scenario with 100 unique users. Prepare the data in CSV file with 100 user records with username and password, and you can use this file data in every thread through variables in your requests/samplers by using this configuration element.
- Add “CSV Data Set Config” Element where it will be used
- You can give file path or filename of your text/CSV file. If file is stored in the same location as your “Test Plan” is, then give only filename.
- Give variable names for text/CSV file column values, use these variable as “$username” / “$password” in samplers
- Select sharing mode
Following is the sample text file which contains user credentials for login scenario:
2: HTTP Request Defaults:
HTTP Request Defaults Configuration Element let us set default values to be used in HTTP Request Samplers.
For Example: You need to send 100 HTTP Requests to the same server, then you can utilize HTTP Request Default element with your “Server Name or IP”. Now, there is no need to give “Server Name or IP” in all 100 HTTP Requests explicitly. The requests will get “Server Name or IP” from the HTTP Request Default, just give the relative path of the web pages in samplers/requests.
- Give Server Name or IP without (http://) prefix.
3: User Defined Variables (UDV):
User Defined Variables Element let us use default variables and values in the test plan. If you need to use UDV in only one Sampler, then define it under that Sampler. If you need to use UDV in multiple parts, then define it at the start of Test Plan.
4: HTTP Cookie Manager
HTTP Cookie Manager is used to store cookies which targeted server sends in the response of your Http request. The saved cookies can be used in other samplers/requests of the Test Plan.
- You can also add User Defined Cookies, these cookies will be shared to all the Threads.
- Cookies can be seen using the “View Results Tree” Listener.
- Such Cookies usually have Expiration time far in the future.
HTTP Cookies Manager Panel looks like below figure: