JMeter 脚本优化
变量修改
- 线程数修改为变量
threadNum, 利用函数助手${__P(threadNum,1)} - Ramp-UP 时间修改为变量
rampUP, 利用函数助手${__P(rampUP,1)} - 持续时间修改为变量
ontime, 利用函数助手${__P(ontime,1)}
** 说明:如果需要将其他参数变成变量,也是同理**

命令行执行脚本
- 执行命令
1 | # jmeter -n -t [jmx file] -l [results file] -e -o [Path to web report folder] |
- 命令传递参数
1 | # jmeter -n -t [jmx file] -J[变量名称=参数] -J[变量名称=参数] -J ··· |