其他分享
首页 > 其他分享> > 一个jmeter自动化问题(对图片进行Base64、下载图片并保存到本地)

一个jmeter自动化问题(对图片进行Base64、下载图片并保存到本地)

作者:互联网

一微信好友的问题

上周,收到一微信好友的求助:jmeter做自动化,上一个请求返回结果里面有一个链接,这个链接对应了一张图片,下一个请求的入参之一是这张图片base64加密后的字符串。

思路是比较清晰的:先关联获取上一个请求返回的url,然后beanshell获取这张图片的字节流,转换为字节数组,最后进行base64加密获取加密后的字符串。

但是,ta的实现过程还是比较艰辛的,除了基础不够扎实,还遇到了坑,我简单复盘总结下。

jemter脚本

正则提取url

图片

获取图片并加密

图片

请求1返回的结果如下

图片

请求2不成功,对加密后的字符串进行解码,只显示了一部分,怀疑是数据获取不完整。

图片

问题验证

在beanshell中,不建议写过多脚本,因为没有代码提示以及错误提醒,建议在idea中写,然后在beanshell中引用java文件或者jar包的方式,参考:jmeter对入参进行MD5加密的5种方式。加密需要用到commons-codec-1.11.jar,jmeter已经自带,所以,我们可以直接在idea中引用,添加jar包:File——>Project Structure——>Libraries——>New Project Library(+)——>Java——>选择jar包(或者一个路径)——>选择要添加到模块——>最后,还可以为Library自定义一个名称图片

package com.qzcsbj;

import org.apache.commons.codec.binary.Base64;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;

/**
 * @create : 2021/4/12 06:30
 * @description : <描述>
 */
public class GetImageBase64 {
    public static String getImageBase64(String url) throws MalformedURLException {
        URL u = new URL(url);
        InputStream input = null;
        byte[] bytes = null;
        try {
            URLConnection urlConnection = u.openConnection();
            urlConnection.setConnectTimeout(10*1000);
            input = urlConnection.getInputStream();
            int contentLength = urlConnection.getContentLength();
            System.out.println("contentLength:" + contentLength);
            int available = input.available();
            System.out.println("available:" + available);
            bytes = new byte[available];
            input.read(bytes);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return Base64.encodeBase64String(bytes);
    }

    public static void main(String[] args) throws MalformedURLException {
        String url = "https://files-cdn.cnblogs.com/files/uncleyong/qzcsbj.bmp";
        String imageBase64 = getImageBase64(url);
        System.out.println(imageBase64);
    }
}

  

运行结果:

contentLength:8270
available:2625

 

 说明读取到的字节数比实际的小,查看源码:urlConnection.getInputStream()返回的是InputStream

图片

InputStream是一个抽象类

图片

下面说用bytes = new byte[available];这种创建字节数组的方式是不可以的

图片


但是,如果是读取本地图,用available方法可以,这是为什么呢?FileInputStream继承了抽象类InputStream

InputStream input = new FileInputStream("C:\\Users\\ren\\Desktop\\pic.png");


FileInputStream实现了available方法,最终是通过本地方法available0实现的。 

图片

 

解决方案

使用IOUtils类的copy方法:

package com.qzcsbj.demo;

import org.apache.commons.codec.binary.Base64;
import org.apache.tika.io.IOUtils;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;

/**
 * @create : 2021/4/12 06:42
 * @description : <描述>
 */
public class GetImageBase64 {
    public static String getImageBase64(String url) throws MalformedURLException {
        URL u = new URL(url);
        InputStream input = null;
        byte[] bytes = null;
        try {
            URLConnection urlConnection = u.openConnection();
            urlConnection.setConnectTimeout(10*1000);
            input = urlConnection.getInputStream();
            ByteArrayOutputStream output = new ByteArrayOutputStream();
            IOUtils.copy(input, output);
            bytes = output.toByteArray();

        } catch (IOException e) {
            e.printStackTrace();
        }
        return Base64.encodeBase64String(bytes);
    }

    public static void main(String[] args) throws MalformedURLException {
        String url = "https://files-cdn.cnblogs.com/files/uncleyong/qzcsbj.bmp";
        String imageBase64 = getImageBase64(url);
        System.out.println(imageBase64);
    }
}

  


加密结果:

/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFB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FABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQB//9k=


解码:

图片

 

解码结果:

图片

 

请求2也成功了

图片

 

 

 

 

 

bak:https://www.cnblogs.com/uncleyong/p/14630129.html

 

标签:available,urlConnection,java,String,url,Base64,import,jmeter,图片
来源: https://www.cnblogs.com/uncleyong/p/15202214.html