JMeter – User Parameters

This element is used to define the user (thread) specific parameters, although the CSV Data Set Config is an easy and flexible method for parameterization. In JMeter, the ‘User Parameters’ preprocessor can be used when you have less test data which can be used in a repetitive manner and shared by all the threads. As I mentioned, when you have less test data then you can easily insert the values in the User Parameter field and allow threads to share the test data. A set of parameters get reused in case less data than the number of threads. User Variables can also be defined in the Test Plan using ‘User Defined Variables‘ but those are not specific to individual threads.

What is the difference between User Parameter, User Defined Variable and CSV Data Set Config?

  • User Parameter is a preprocessor whereas CSV Data Set Config and User Defined Variables are Config Elements. 
  • In User Defined Variables, there is only one value of the variable can be defined whereas, in User Parameters and CSV Data Set Config, multiple values can be defined for a variable.
  • Test Data cannot be added via an external file in User Parameters and User Defined Variables whereas CSV Data Set Config use a .csv file format as test data.
  • Since there is only one value that can be given in User Variables so bulk test data can not be used. The bulk test data can be added manually in User Parameters, but it is time-consuming. Although the primary purpose of the CSV Data Set Config is to access an external file so that bulk test data can be available for the test.

How to add a ‘User Parameters’ preprocessor?

Follow the below steps:

  1. Select the ‘Sampler’ node where you want to add the preprocessor
  2. Right-click on the node
  3. Hover the mouse on ‘Add’
  4. Hover the mouse on ‘Pre Processors’
  5. Click ‘User Parameters’
JMeter - User Parameters
Figure 01: User Parameters PreProcessor

What are the input fields of ‘User Parameters’?

‘User Parameters’ has the following inputs:

  1. Name: To provide the name of the preprocessor
  2. Comments: To provide arbitrary comments (if any)
  3. Update Once Per Iteration: If you want to update variables using only one iteration and to make sure the values are updated each time based on the execution of the parent controller, you need to check the “Update Once Per Iteration” checkbox. 
  4. Parameters: In this section variables, the number of users and the variable’s value are added.
  5. Name: Declare the name of the variable. 
  6. User_<n>: The variable value used by User_<n> thread where n is thread index. 
  7. Add Variable: Click this button to add a new row. 
  8. Add User: Click this button to add a new column. 
  9. Delete Variable: To delete the row. 
  10. Delete User: To delete the user. 
  11. Up: To shift the row up. 
  12. Down: To shift the row down.

You may be interested:

Leave a Comment