当前位置:网站首页>Jmeter接口测试,关联接口实现步骤(token)
Jmeter接口测试,关联接口实现步骤(token)
2022-06-25 08:08:00 【fish_study_csdn】
目录
目录
1、在测试计划里新建一个线程组,在线程组中新建一个登录的http请求
jmeter 用于接口测试时,后一个接口经常需要用到前一次接口返回的结果,应该如何获取前一次请求的结果值,应用于后一个接口呢?
一般有正则提取器和json提取器两种
拿一个登录的例子来说明,获取评论列表需要在登录后可查看
1、在测试计划里新建一个线程组,在线程组中新建一个登录的http请求
2 、添加一个正则提取器:
正则表达式匹配到token的值,赋给变量dlt
引用名称:自己定义的变量名称,后续请求将要引用到的变量名,如填写的是:dlt,后面的引用方式是${dlt}
正则表达式:提取内容的正则表达式,相当于lr中的关联函数
【() 括起来的部分就是需要提取的,对于你要提的内容需要用小括号括起来】
【. 点号表示匹配任何字符串】
【+ 一次或多次】
【? 在找到第一个匹配项后停止】
3、 再新建一个http请求,需要用到token
4、 再新建一个http请求头
5 、发送请求:
6 、除了用正则还可以用json提取器
我没有重新建一个线程组,在原来对线程组的基础上做的
6.1 把原来的正则提取器禁用
6.2 在登录的http请求上建立一个json提取器
6.3 使用token的查询接口不变
6.4 查询接口 OK
边栏推荐
- Is it safe to open a stock account through the account opening QR code of the account manager? Or is it safe to open an account in a securities company?
- nodejs 使用Express框架demo
- 声纹技术(六):声纹技术的其他应用
- Is it safe for Huatai Securities to open a stock account on it?
- 微信小程序_7,项目练习,本地生活
- SwipeRefreshLayout+RecyclerView无法下拉问题排查
- Problems caused by Gil problems and Solutions
- 【515. 在每个树行中找最大值】
- C language "Recursion Series": recursively realizing the n-th power of X
- 如何实现一个系统调用
猜你喜欢
【操作教程】TSINGSEE青犀视频平台如何将旧数据库导入到新数据库?
wav文件(波形文件)格式分析与详解
关于I/O——内存与CPU与磁盘之间的关系
城链科技平台,正在实现真正意义上的价值互联网重构!
GPU calculation
Getting to know the generation confrontation network (11) -- using pytoch to build wgan to generate handwritten digits
Incluxdb time series database
C language "recursive series": recursive implementation of 1+2+3++ n
EasyPlayer流媒体播放器播放HLS视频,起播速度慢的技术优化
检测点是否在多边形内
随机推荐
紧急行政中止令下达 Juul暂时可以继续在美国销售电子烟产品
《乔布斯传》英文原著重点词汇笔记(五)【 chapter three 】
Data preprocessing: discrete feature coding method
【无标题】**数据库课设:三天完成学生信息管理系统**
View all listening events on the current page by browser
故障:Outlook 收发邮件时的 0x800CCC1A 错误
Stimulsoft ultimate presents reports and dashboards
第十五周作业
tp6自动执行的文件是哪个?tp6核心类库有什么作用呢?
Is it safe to open a stock account through the account opening QR code of the account manager? Or is it safe to open an account in a securities company?
《乔布斯传》英文原著重点词汇笔记(二)【 chapter one】
UEFI: repair efi/gpt bootloader
从别人库里拷贝的游戏如何再自己的库里显示
开户券商怎么选择?在线开户是安全么?
Advanced technology Er, meet internship position information
Object. Can defineproperty also listen for array changes?
Getting to know the generation confrontation network (11) -- using pytoch to build wgan to generate handwritten digits
二、训练fashion_mnist数据集
About i/o -- the relationship between memory and CPU and disk
Nips 2014 | two stream revolutionary networks for action recognition in videos reading notes