背景
测试一个活动,需要多个账户同时上榜,按每个账号数值来排名并进行淘汰
以往:伙伴们通过人工登录多个账号手动触发功能,让账号得到期望值,期望排名来进行测试
期望:有没有通过直接调接口,然后批量给账号送不同的值,达到排名并进行末位淘汰
工具:jmeter、excel
效果:成功通过jmeter工具批量给账户加值了

步骤
创建CSV Data Set Config

填入参数,选中的4个参数即可

创建http request

配置http请求

配置线程

最后运行,就实现了批量给账户送不同的值,效率提高了80%。
遇到的问题
但在调试过程中,可能会遇到一些问题,去搜索解决就好了
[图片上传中...(image.png-94e866-1623981250575-0)]
1、若接口请求通了,但报错参数异常
看request headers如下,原来是content-type不对,因为我的request body格式是json格式的,所以content-type应是application/json

创建个httprequest请求头管理组件,配置content-type为application/json就解决了

2、执行时报错:lllegal character found in host:'/'

检查下链接上的http ip端口要分开写
http://5.5.5.6:2020 http写在Protoclo[]:里,后面的ip端口或域名再写在IP上

小问题虽然不断,但强大的搜索引擎上可以搜索到答案,在此实践过程中带着目的去搜索扒拉,是可以找到答案的,也正是遇到问题,解决问题的过程,更锻炼我们熟悉工具的使用和检索能力。
每天进步一点点即可~~
网友评论