当前位置:网站首页>如何用jmeter做接口测试
如何用jmeter做接口测试
2022-06-25 21:50:00 【老T教测试】
1,了解jmeter接口测试的整体架构
1)测试计划:这个不用管,这个是固定默认的
2)线程组:从业务层面上可以理解为是一整个的业务场景或流程,而在线程组下面可以包括多个http请求
3)http请求:业务场景下支撑起整个业务的接口,简单来说就是在这里设置接口
4)查看结果树:查看接口的请求或者响应等等信息。

2,整体架构细致解释
1)线程组:
对于我们做接口测试来说,在线程组里边只需要理解其中的循环次数这一功能即可,从字面意思上来说不难理解,就是对请求接口的循环次数。注:每个线程组的操作只作用于线程组下的http请求,如果创建了有多个线程组,每个线程组独立,操作不串通不干扰。

2)http请求:
协议:表示接口的协议,一般为http或https。
服务器名称或ip:表示的是域名或者路由。
端口号:接口的端口号,如果没有单独设置一般这里默认不填
http请求:接口的请求方式,可以下拉选择
路径:接口的路径
参数:上传表单数据
消息体数据:接口需要上传文本或其他格式的数据时会用到
文件上传:上传的文件设置
假设我有一个post请求,端口号为88888的login接口:https://applogin.com/login。他需要传2个参数,一个是users,还有一个是password。下图为在jmeter上的请求设置。

3)查看结果树:
查看接口响应或请求内容,大致分为2部分,一部分是内容展示格式,另一部分是内容的展示,注:点击顶部的绿色箭头执行,是左边的那个箭头不是右边的那个
文本格式

内容展示(请求和响应信息)

后期文章会讲解:请求头,参数,断言,以及提取器
如果缺少实验的接口可私聊评论,用Python写了3个接口,数据内容来源于表格,登录,注册,注销。
边栏推荐
- 记|一次exists关键字的学习记录
- Hotspot JVM "01" class loading, linking and initialization
- Unity技术手册 - 粒子基础主模块属性-上
- 2022-2028 global carbon fiber unidirectional tape industry research and trend analysis report
- A3.ansible production practice case -- system initialization roles
- 实战:typora里面如何快捷改变字体颜色(博客分享-完美)-2022.6.25(已解决)
- Why is BeanUtils not recommended?
- Obsidian basic tutorial
- Chapter 3 use of requests Library
- Unity技术手册 - GetKey和GetAxis和GetButton
猜你喜欢

Tiger DAO VC产品正式上线,Seektiger生态的有力补充

Ribbon core ⼼ source code analysis

OSPF - detailed explanation of GRE tunnel (including configuration command)

ES6 --- 数值扩展、对象拓展

Programmer weekly (issue 4): the wealth view of programmers

27 Chinese scholars including Yaoban and chendanqi from Tsinghua won the awards, and the list of winners of Sloan award in 2022 was issued

Conglin environmental protection IPO meeting: annual profit of more than 200million to raise 2.03 billion

CVPR2022教程 | 马里兰大学《机器学习遥感处理:农业与粮食安全》教程

简单好用的缓存库 gcache

2022-2028 global RBI platform industry research and trend analysis report
随机推荐
c语言与数据库的创建使用
Analysis of gpl3.0 license software copyright dispute cases
Hotspot JVM "01" class loading, linking and initialization
再突破!阿里云进入Gartner云AI开发者服务挑战者象限
China soft magnetic material market demand status and prospect scale forecast report 2022-2028
2022 love analysis · panoramic report of it operation and maintenance manufacturers
Use of local stack in flask
Talk about adapter mode
数据治理,说起来容易,做起来难
Application runtime layotto enters CNCF cloud native panorama
Use apiccloud AVM multi terminal component to quickly realize the search function in the app
Unity技术手册 - GetKey和GetAxis和GetButton
Data governance is easier said than done
Open source optimized VVC encoder in general scenarios
Chapter 3 use of requests Library
ES6 -- 形参设置初始值、拓展运算符、迭代器、生成函数
2022-2028 global proton exchange membrane hydrogen electrolyzer industry survey and trend analysis report
Mysql database index
剖析虚幻渲染体系(16)- 图形驱动的秘密
Hello, teacher, is it really safe to open an account in Alipay fund?