从jmeter读取csv文件,执行用例
1.添加CSV Data Set Config,配置
配置项目:
Filename |
填写文件路径 |
File Encoding | UTF-8 |
Variable Names | user_name,user_pwd(填写要读取的变量的名称) |
Delimiter | ,(csv文件里变量之间的分割符号) |
Ignore first line? | True(如果首行是参数名,此配置需要为True) |
Recycle on EOF? | False |
Stop thread on EOF? | True |
Sharing Mode | All threads |
2.添加HTTP请求,Add-->Simpler-->Http request
配置http请求,body_data里的参数以${变量名},读取csv文件中的变量,变量名要和csv中的变量名一致,⚠️:要配置 content_type,如果是全局性,直接配置Http header manager
⚠️:要配置 content_type,如果是全局性,直接配置Http header manager
3.添加 reponse assertion
4.配置 View results tree & debug sampler,组合可查询请求中的参数