1、接口获取验证码并保存response图片
2、后置处理器,将图片转换为base64
SampleResult.setIgnore(); import java.io.*; import org.apache.commons.codec.binary.Base64; String image=vars.get("png"); byte[] data = null; try { InputStream in = new FileInputStream(image); data = new byte[in.available()]; in.read(data); in.close(); } catch (IOException e) { e.printStackTrace(); } Base64 base64=new Base64(); vars.put("base64",base64.encodeToString(data));
3、利用ocr 工具 识别
图中127.0.0.1 为启动本地ocr工具(下图.exe双击即可启动)
链接:https://pan.baidu.com/s/1LEacx2mnUkJGBm7eHXOqfA
提取码:dcwo
标签:base64,vars,Base64,验证码,new,图形,jmeter,data From: https://www.cnblogs.com/ada-luo/p/18089618