当前位置:网站首页>Explanation of assertions in JMeter
Explanation of assertions in JMeter
2022-06-25 08:56:00 【fish_ study_ csdn】
One 、JMeter Assertion
1.1 The concept of assertion
Assertion : Let the program judge whether the expected results are consistent with the world results
Tips :JMeter 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, detection mechanism is needed to improve the accuracy of testing
1.2 JMeter Common assertions in
(1) Response assertion
(2)JSON Assertion
(3) Duration assertion (Duration Assertion)
Two 、 Response assertion
How to add : test plan --> Thread group -->HTTP request -->( Right click to add ) Assertion --> Response assertion
To configure :
(1) Test fields : Fields to check
2) Pattern matching rules : What rules need to be used to check : Regular 、 And 、 or 、 Not 、 be equal to
Test fields | |
The response text | Keywords in the response body |
Response code | Response code ,200 |
Response information | The information returned after the response code ,OK |
Response Headers | When testing the protocol, use , This is not used by general testing businesses |
Request Headers | |
URL sample | Content sent out , Generally, it is not checked , It all depends on the content of the response |
Document(text) | Check text Formatted text |
Ignore Status | Test the abnormal scenario , Determine the state of the wrong response , The result is not marked red |
Request Data |
Include | Regular |
matching | Regular |
be equal to Equals | |
contain Substring | no 、 perhaps 、 And |
(3) Test mode : Value to be verified , You can fill in multiple values for comparison
Such as : request :https://www.baidu.com
Check : Let the program check whether the response data contains “ Baidu once , You will know ”
Operation steps :
(1) Add thread group
(2) add to HTTP request
(3) Add response assertion :HTTP request --> add to --> Assertion --> Response assertion
(4) Add assertion results : Thread group --> add to --> Monitor --> assertion results
(5) Add view result tree
3、 ... and 、JSON Assertion
This component is used to JSON Document validation , The verification steps are as follows :
1. First analysis JSON data , If the data is not JSON, The verification fails
2. Use Jayway JsonPath 1.2.0 Search the specified path using the syntax in . If you can't find the path , Will fail
3. If found in the document JSON route , And it is required to verify the expected value , Then it will perform the verification operation
Mode of operation : test plan --> Thread group -->HTTP request -->( Right click to add ) Assertion -->JSON Assertion
Operation steps
1. Add thread group
2. add to HTTP request
3. add to JSON Assertion
Apply to HTTP The response is a JSON Format
To configure :
(1)JSON PATH:$.msg
(2) Check “Additional assert value”
(3)expected value Fill in The query is successful
4. Add assertion results
5. Add view result tree ( A mistake and a success )
边栏推荐
- 106. 简易聊天室9:使用 Socket 传递音频
- Check whether the point is within the polygon
- QSS buttons of different styles
- Are the top ten securities companies at great risk of opening accounts and safe and reliable?
- Wechat applet_ 7. Project practice, local life
- Exchange: manage calendar permissions
- 声纹技术(一):声纹技术的前世今生
- Is it really safe to pay new debts? Is it risky
- [operation tutorial] how does the tsingsee Qingxi video platform import the old database into the new database?
- wav文件(波形文件)格式分析与详解
猜你喜欢
Oracle-单行函数大全
compiling stm32f4xx_ it. c... “.\Objects\BH-F407.axf“ - 42 Error(s), 1 Warning(s).
compiling stm32f4xx_it.c... “.\Objects\BH-F407.axf“ - 42 Error(s), 1 Warning(s).
How to solve the 10061 error of MySQL in Linux
高速缓冲存储器Cache的映射方式
检测点是否在多边形内
LVS-DR模式多网段案例
Jmeter接口测试,关联接口实现步骤(token)
Wechat applet_ 7. Project practice, local life
声纹技术(六):声纹技术的其他应用
随机推荐
【MYSQL】事务的理解
Level 6 easy to mix words
QSS buttons of different styles
atguigu----17-生命周期
第十五周作业
C # startup program loses double quotation marks for parameters passed. How to solve it?
五、项目实战---识别人和马
声纹技术(四):声纹识别的工程部署
通过客户经理的开户二维码开股票账户安全吗?还是去证券公司开户安全?
IC研发常用英文术语缩写
When unity released webgl, jsonconvert Serializeobject() conversion failed
2021 "Ai China" selection
Notes on key words in the original English work biography of jobs (IV) [chapter two]
OpenFOAM:底层
Exchange: manage calendar permissions
5、 Project practice --- identifying man and horse
How to increase the monthly salary of software testing from 10K to 30K? Only automated testing can do it
How to design test cases
RTOS 多线程下hardfault问题总结
《乔布斯传》英文原著重点词汇笔记(一)【 Introduction 】