postman 信息头用户名密码如何在jmeter中实现
场景:需要测试一个登录场景,postman中是basic author,如何在jmeter中实现?
方法一:jmeter配置元件中有"HTTP授权管理器",选择对应的组件
方法二:提前对用户名密码加密放入到信息头中
加密代码:
package org.jmeter; import cn.hutool.core.codec.Base64; public class dateProduce { public static void main(String[] args) { String a="ai_user_login_test:z0hAdYgwMhCXk3iN6GWF"; String encode = Base64.encode(a); System.out.println(encode); } }