1. 启动报错 Windows RegCreateKeyEx(...) returned error code 5
缺少注册表,添加注册表 HKEY_LOCAL_MACHINE\Software\JavaSoft\Prefs
2. html 报告自定义配置,user.properties
jmeter.save.saveservice.bytes = true
jmeter.save.saveservice.label = true
jmeter.save.saveservice.latency = true
jmeter.save.saveservice.response_code = true
jmeter.save.saveservice.response_message = true
jmeter.save.saveservice.successful = true
jmeter.save.saveservice.thread_counts = true
jmeter.save.saveservice.thread_name = true
jmeter.save.saveservice.time = true
jmeter.save.saveservice.timestamp_format = ms
jmeter.save.saveservice.timestamp_format = yyyy-MM-dd HH:mm:ss
3. 引用外部lib包
jmeter.properties 配置 plugin_dependency_paths=../dependencies/lib; (自定义路径)
4. 执行生成html报告
bash jmeter -n -t ../files/*.jmx -l D://Report/result.jtl -e -o D://Report
5. 后置脚本获取请求返回结果
String retStr = prev.getResponseDataAsString();
6. 后置脚本设置变量与获取
vars.put("sessionid",String.valueOf(sessionid));
String sessionStr = vars.get("sessionid");