在jMeter
如何获得多部主体在BeanShell PreProcessor
我需要得到的图像数据和后参数JMeter的如何获得多域主体在BeanShell的预处理器
使用sampler.getArguments();
我能得到这个职位的参数,但不图像文件
请帮我
在jMeter
如何获得多部主体在BeanShell PreProcessor
我需要得到的图像数据和后参数JMeter的如何获得多域主体在BeanShell的预处理器
使用sampler.getArguments();
我能得到这个职位的参数,但不图像文件
请帮我
您可以使用采样API的getHTTPFiles方法。
sampler.getHTTPFiles()
将返回数组中的文件路径HTTPFileArg,通过它您可以在运行时更新新文件。
更新:
String path = sampler.getHTTPFiles()[0].getPath();
byte[] array = Files.readAllBytes(new File(path).toPath());
喜欢的东西:
File image = new File(sampler.getHTTPFiles()[0].getPath());
//do what you need with the image file
如果需要扩展的图像信息看一看ImageIO。 For more Beanshell tips and tricks check out How to Use BeanShell: JMeter's Favorite Built-in Component
联系我如何以字节为单位读取文件的内容 –
@BikeshMAnnur,检查更新 – vins