1. 在测试计划中自定义变量
2. 通过${变量名}引用
3. 可通过正则表达式提取器提取Server返回的内容,供后续使用
4. 提取出来的变量可以被这样引用 ${变量名_g1}
[refname]_g#, and # is the group number, where group 0 is the entire match, group 1 is the match from the first set of parentheses, etc.
变量参数化函数:
Ctrl + F ,打开函数助手,选择__random,输入随机数范围,或在需要参数化的地直接输入,“${__Random(1,100,ran)}"
__StringFromFile,从文件读取数。2.3.4不能指定读取位置,指定的话有问题读不出数据
__Counter,__Javascript,__threadNum,__machineName,__Log,__Logn
5. 右键点击jmeter 中需要参数化的某个请求,选择添加config element -> csv data set config,设置相关内容即可