How to parameterize in JMeter?

There are various methods for parameterization in JMeter, one commonly used method is as follows:

  1. Open JMeter and create a test plan.
  2. Right-click on the test plan, then select “Add -> Thread Group”.
  3. Right-click on the Thread Group, select “Add -> Config Element -> CSV Data Set Config” option.
  4. Select a CSV file that contains data to parameterize. The format of the CSV file should have one parameter value per row, with each column corresponding to a parameter.
  5. Variable Names: Set one or more variable names to store parameter values from the CSV file. Multiple variable names can be separated by commas.
  6. Default separator between parameter values is a comma.
  7. Recycle on EOF: If the parameter values in the CSV file are all used up, should we start using the values from the first row again?
  8. Should all threads in the thread group be stopped if the parameter values in the CSV file are exhausted?
  9. Add requests that need to be parameterized, such as HTTP requests, to the test plan.
  10. ${variable name}
  11. your username
  12. When running the test plan, JMeter will send requests sequentially based on the parameter values in the CSV file, enabling parameterization.

Please take note:

  1. The path of the CSV file can be either a relative path or an absolute path. It is recommended to place the CSV file in the same directory as the test plan file when using a relative path.
  2. The parameter values in a CSV file can contain special characters, such as commas and quotes. If a parameter value contains a delimiter, you can use quotes to enclose it.
  3. Multiple CSV data files can be used to parameterize multiple parameters in a component, with each CSV data file corresponding to one parameter.
  4. If different parameter values are needed for each thread, the CSV file configuration element can be placed in a Loop Controller under the Thread Group, such as a Loop Controller or Random Controller.
Leave a Reply 0

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


广告
Closing in 10 seconds
bannerAds