当前位置:网站首页>如何用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个接口,数据内容来源于表格,登录,注册,注销。
边栏推荐
- 27 Chinese scholars including Yaoban and chendanqi from Tsinghua won the awards, and the list of winners of Sloan award in 2022 was issued
- 2022-2028 global cloud based remote browser isolation industry research and trend analysis report
- Travel notes of 2022giao
- Fujilai pharmaceutical has passed the registration: the annual revenue is nearly 500million yuan. Xiangyun once illegally traded foreign exchange
- 在线CRUDhasone关联查询报错Unabletouseinternalvariable:List
- ES6 -- 形参设置初始值、拓展运算符、迭代器、生成函数
- Client cannot authenticate via:[TOKEN, KERBEROS]
- Lecture 14 of the Blue Bridge Cup -- number theory [exercises]
- 2022-2028 global RBI platform industry research and trend analysis report
- Why can't the mobile phone be used and the computer be connected
猜你喜欢

2022-2028 global carbon fiber unidirectional tape industry research and trend analysis report

2022-2028 global vacuum jacket system industry survey and trend analysis report

2022-2028 global selective laser sintering service industry research and trend analysis report

Nacos source code analysis 01 code structure

Why absolute positioning overlaps
![[intensive lecture] 2022 PHP intermediate and advanced interview questions (II)](/img/50/c9572beaa035d5e6e78a57fcd1302c.jpg)
[intensive lecture] 2022 PHP intermediate and advanced interview questions (II)

2022-2028 global TFT LCD touch screen industry research and trend analysis report
Interview shock 23: talk about thread life cycle and transformation process?

2022-2028 global industrial TFT LCD industry survey and trend analysis report

Facing the "industry, University and research" gap in AI talent training, how can shengteng AI enrich the black land of industrial talents?
随机推荐
剖析虚幻渲染体系(16)- 图形驱动的秘密
Why absolute positioning overlaps
Travel notes of 2022giao
ES6 -- 形参设置初始值、拓展运算符、迭代器、生成函数
Open source optimized VVC encoder in general scenarios
2022-2028 global open source cloud storage industry research and trend analysis report
2022-2028 global RBI platform industry research and trend analysis report
Intimacy - [comfortable exit] - final communication to reduce injury
Canoe: the fifth simulation project: simulation + test
Evaluate the generalization performance of models and build integrated models using out of pocket prediction (oof)
数据治理,说起来容易,做起来难
2022-2028 global industrial touch screen industry research and trend analysis report
Flutter 網絡請求封裝之Dio(Cookie管理、添加攔截器、下載文件、异常處理、取消請求等)
Unity技术手册 - 粒子基础主模块属性-上
荣耀推出积分商城,支持兑换各种荣耀产品
Why can't the mobile phone be used and the computer be connected
Jingwei Hengrun is registered through the science and Innovation Board: it plans to raise 5billion yuan, with a 9-month revenue of 2.1 billion yuan
What are the channels for Internet advertising to gain customers?
Ribbon core ⼼ source code analysis
Analysis of gpl3.0 license software copyright dispute cases