JMeter中获取Request内容写到Txt文件中
参照文档 https://blog.csdn.net/chenqinglanhao/article/details/124125435
import java.net.URLDecoder;
import org.json.*;
//String requestAll = prev.getSamplerData(); ---获取Request所有内容
//print("requestAll"+requestAll);
String requestBody = prev.queryString; --仅获取RequestBody内容
print("requestBody:"+requestBody);
FileWriter fileW = new FileWriter("${baseDir}/data/cases/${CaseID}-${CaseName}.txt",true);
BufferedWriter out = new BufferedWriter(fileW);
out.write(requestBody);
out.close();
fileW.close();
标签:requestAll,Txt,fileW,Request,requestBody,JMeter,out From: https://www.cnblogs.com/lcl9668/p/17531415.html