Jmeter添加BeanShell预处理程序保存正则提取参数
使用如下代码:
og.info(vars.get("mid")); FileWriter fstream = new FileWriter("D://Beanshell.txt", true); BufferedWriter out = new BufferedWriter(fstream); out.write(vars.get("mid")+"\n"); out.close(); fstream.close();
mid为为正则表达式取值,利用函数转换为文件Beanshell.txt。