Common methods used for parameterization:
- Adding configuration symbols: User-defined variables
- Using the function Helper
- Adding configuration components: CSV Data Set Config
- Add Front Processor: BeanShell preprocessor
Adding configuration symbols: User-defined variables
Use in Request:
Replace the original parameter value with ${userid} where it needs to be parameterized
Using the function Helper
Example:
Generates a 5-bit character string that is randomly taken from 1234567890QAZWSXEDCRFVTG, and the resulting random string is assigned to the variable ID.
The first occurrence of the parameterized position replaces the original parameter value with ${__randomstring (5,1234567890qazwsxedcrftg,id)}, and the original parameter value is replaced elsewhere with ${id}.
Import from the CSV file:
Adding configuration components: CSV Data Set Config
Add Front Processor: BeanShell preprocessor
Read and change the value of the variable
Vars.get (String key): Gets the value of the variable from the JMeter
Vars.put (String key,string value): Data is stored in the JMeter variable
Jmeter Web Performance Test Introduction (V): Jmeter parametric Request