Jmeter参数化
2018-06-01 本文已影响13人
蔡CooCoo
一、依赖与函数助手做参数化
1.在配置文件处选择CSV Data Set Config

2.编写数据(这边是使用文本方式编写数据的)

3.在Body Data 处使用参数

遇到问题如下:
查看结果树出现乱码

解决方案一:在jmeter.properties文件默认编码为:ISO-8859-1
# The encoding to be used if none is provided (default ISO-8859-1)
修改为:sampleresult.default.encoding=UTF-8
解决方案二:在CSV Data Set Config 处的File encoding输入utf-8

解决方案三:右键httpSampler,添加“BeanShell PostProcessor”元件

三种方法都使用过,但还是出现‘乱码’,又继续百度相关问题得知,把.scv更换成.txt,由于是使用execl编写的相关参数,更换文件后缀名之后,转为.txt时出现乱码;
最终解决方案:新建一个后缀名为.txt的文本。