当前位置:网站首页>Do you know several assertion methods commonly used by JMeter?
Do you know several assertion methods commonly used by JMeter?
2022-07-05 19:24:00 【Xiaowu knock code】
In the use of Jmeter Conduct performance test or interface automation test , A function often used , It's an assertion . Assertion is to add a layer of judgment mechanism at the return level of the request . Because the request was successful , It doesn't mean the results are right , Therefore, we need a judgment mechanism to improve the accuracy of testing . this paper This paper mainly introduces 3 Common assertions : Response assertion 、JSON Assertion 、 Assertion duration .
One 、 Response assertion (Response Assertion)
Response assertion is the most commonly used assertion method , It mainly asserts the text content in the response result , For example, whether the response result contains the specified value , Or whether it is equal to the specified value . Response assertions can be applied to response results of various return types , Such as Test、html、application/json、application/xml etc. .
1、 Case study
Send a request :
http://www.hctestedu.com/
Assertion checking : Check whether the response result contains “ Lemon class software testing ” Text content of
2、 Operation steps
The first 1 Step : Add thread group
The first 2 Step : add to HTTP request
The first 3 Step : stay HTTP Add response assertion under request
The first 4 Step : Add assertion results and add view result tree
The first 5 Step : After running the interface , Look at the assertion result and look at the result tree
Two 、JSON Assertion
JSON Assertion is also an assertion method often used in testing , It is generally used to assert whether a field value is equal to the value we specify . therefore JSON Assertions can only be made against responses that result in applicaton/json Assert in the format . If it's another type ( Such as :Test、html), You cannot use this method .
1、 Case study
Send a request :
http://47.115.15.198:7001/smarthome/user/login
– Login interface
Assertion checking : Check the data in the response ,user_name Whether the content corresponding to the node is "lemonn"
2、 Operation steps
The first 1 Step : Add thread group
The first 2 Step : add to HTTP request
The first 3 Step : stay HTTP Add response assertion under request
The first 4 Step : Add assertion results and add view result tree
The first 5 Step : After running the interface , Look at the assertion result and look at the result tree
3、 ... and 、 Assertion duration (Duration Assertion)
Assertion duration is usually used for performance testing , Generally used to check HTTP Whether the response time of the request exceeds the expected value . And this response time is a performance index that is often concerned in performance testing .
1、 Case study
Send a request :https://www.baidu.com/
– Baidu official website interface
Assertion checking : Check that the response time is less than 200ms
2、 Operation steps
The first 1 Step : Add thread group
The first 2 Step : add to HTTP request
The first 3 Step : stay HTTP Add response assertion under request
The first 4 Step : Add assertion results and add view result tree
The first 5 Step : After running the interface , Look at the assertion result and look at the result tree
Finally, thank everyone who reads my article carefully , The following online link is also a very comprehensive one that I spent a few days sorting out , I hope it can also help you in need !
These materials , For those who want to change careers 【 software test 】 For our friends, it should be the most comprehensive and complete war preparation warehouse , This warehouse also accompanied me through the most difficult journey , I hope it can help you ! Everything should be done as soon as possible , Especially in the technology industry , We must improve our technical skills . I hope that's helpful ……
If you don't want to grow up alone , Unable to find the information of the system , The problem is not helped , If you insist on giving up after a few days , You can click the small card below to join our group , We can discuss and exchange , There will be various software testing materials and technical exchanges .
Click the small card at the end of the document to receive it |
Typing is not easy , If this article is helpful to you , Click a like, collect a hide and pay attention , Give the author an encouragement . It's also convenient for you to find it quickly next time .
Self study recommendation B Stop video :
Zero basis transition software testing :25 Days from zero basis to software testing post , I finished today , Employment tomorrow .【 Include features / Interface / automation /python automated testing / performance / Test Development 】
Advanced automation testing :2022B The first station is super detailed python Practical course of automated software testing , Prepare for the golden, silver and four job hopping season , After advanced learning, it soared 20K
边栏推荐
- [performance test] jmeter+grafana+influxdb deployment practice
- Apprentissage du projet MMO I: préchauffage
- JAD的安装、配置及集成IDEA
- 【AI 框架基础技术】自动求导机制 (Autograd)
- Technology sharing | common interface protocol analysis
- PHP uses ueditor to upload pictures and add watermarks
- Summer Challenge database Xueba notes, quick review of exams / interviews~
- Fuzor 2020软件安装包下载及安装教程
- IBM大面积辞退40岁+的员工,掌握这十个搜索技巧让你的工作效率至上提高十倍
- Go语言学习教程(十五)
猜你喜欢
微波雷达感应模块技术,实时智能检测人体存在,静止微小动静感知
What are the reliable domestic low code development platforms?
The problem of returning the longtext field in MySQL and its solution
Go语言 | 02 for循环及常用函数的使用
Oracle故障处理:Ora-10873:file * needs to be either taken out of backup or media recovered
Millimeter wave radar human body sensor, intelligent perception of static presence, human presence detection application
word如何转换成pdf?word转pdf简单的方法分享!
【obs】QString的UTF-8中文转换到blog打印 UTF-8 char*
手把手教你处理 JS 逆向之图片伪装
How to choose the notion productivity tools? Comparison and evaluation of notion, flowus and WOLAI
随机推荐
Oracle fault handling: ora-10873:file * needs to be either taken out of backup or media recovered
打新债在哪里操作开户是更安全可靠的呢
XaaS 陷阱:万物皆服务(可能)并不是IT真正需要的东西
#夏日挑战赛#数据库学霸笔记,考试/面试快速复习~
Go deep into the underlying C source code and explain the core design principles of redis
C# 语言的高级应用
C# 语言的基本语法结构
【obs】libobs-winrt :CreateDispatcherQueueController
JAD的安装、配置及集成IDEA
Is it safe for China Galaxy Securities to open an account? Securities account opening
100million single men and women supported an IPO with a valuation of 13billion
MySql中的longtext字段的返回问题及解决
cf:B. Almost Ternary Matrix【对称 + 找规律 + 构造 + 我是构造垃圾】
Go语言学习教程(十六)
Fundamentals of shell programming (Part 8: branch statements -case in)
Go语言 | 02 for循环及常用函数的使用
How to choose the notion productivity tools? Comparison and evaluation of notion, flowus and WOLAI
5 years of experience, 27 days of Android programmer interview, 2022 programmer advanced classic
shell编程基础(第9篇:循环)
Debezium系列之:IDEA集成词法和语法分析ANTLR,查看debezium支持的ddl、dml等语句