Get Knowledge from Video instead of Content:

Monday 30 January 2017

JMeter - PreProcessor - "User Parameters"

This element is used to define the user (thread) specific parameters, although CSV Data Set Config is very easy and flexible method for parameterization. "User Parameters" preprocessor can be used when you have less number of test data which can be used in a repetitive manner and shared by all the thread. As I mentioned, when you have less number of 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 number of 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 .csv file format as a test data.
  • Since there is only one value 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 CSV Data Set Config is to access an external file so that bulk test data can be available for the test.
How to add "User Parameters" preprocessor element?
You can follow the below steps:
1. Select "Sampler" node where you want to add the preprocessor
2. Right-click on the node
3. Mouse hovers "Add"
4. Mouse hovers "Pre Processors"
5. Click "User Parameters"

How to remove "User Parameters" preprocessor element?
You can follow the below steps:
1. Select "User Parameters" node
2. Right click on "User Parameters" node
3. Click "Remove" (Mouse) or "Delete" button from the keyboard
4. Click "Yes"    
What are the attributes of "User Parameters" element?
"User Parameters" has the following attributes:
  • Name: To provide the name of the preprocessor
  • Comments: To provide arbitrary comments (if any)
  • 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. 
  • Parameters: In this section variables, number of users and variable's value are added.
  • Name: Declare the name of the variable. 
  • User_<n>: The variable value used by User_<n> thread where n is thread index. 
  • Add Variable: Click this button to add a new row. 
  • Add User: Click this button to add a new column. 
  • Delete Variable: To delete the row. 
  • Delete User: To delete the user. 
  • Up: To shift the row up. 
  • Down: To shift the row down. 
Previous Topic:
Apache JMeter - "Sample Timeout" Element

Related Topics:


No comments :

Post a Comment