当前位置:网站首页>JMeter response assertion
JMeter response assertion
2022-06-24 20:48:00 【m0_ sixty-two million four hundred and ninety-six thousand nine】
Assertions are also called checkpoints , You can write your expected results into the assertion , If the actual response data shows your expected results , that jmeter It is judged that the interface passes , If the actual results do not meet your expectations , that jmeter The interface fails .
1. Response assertion : Perform Assertion Verification on the response interface of the server , To judge whether the return value of the interface obtained from the interface test is correct

- Add assertions :
- apply to: Usually, only one request is triggered when a request is issued , So check “main sample only” Can ; If you send a request, you can trigger multiple server requests , There is main sample and sub-sample It's too late
2. Response fields to test :
(1.) General http Respond to , Check all “ The response text ”;
(2.)url The sample is right sample Of url To assert that
Response code :http Response code , Such as 101,200,302,404,501 etc. . When we want to verify 404,501 etc. http Response code , You need to check “ ignore status”. Because when http The response code is 400,500 when ,jmeter By default, this request fails ;
3、 Pattern matching :
(1) Include : The return result includes the content you specify
(2) matching : amount to equals . When the return value is fixed , You can return a value to make an assertion , Effect and equals identical ;
(3) SubString: And “ Include ” almost , All means that the returned result includes the content you specify
(4) no : It's equivalent to taking the opposite . If the assertion turns out to be true, Check “ no ” after , The final assertion result is false. If the assertion turns out to be false, Check “ no ” after , The final assertion result is true
4、 The pattern to test : Enter the expected value of the result

Does not match the entered expectations , It is judged that the task failed , View the result tree and mark the task result in red ;
Match the expectations entered , It is judged that the task is successful View the result tree and mark the task result in green .
边栏推荐
- Learn together and make progress together. Welcome to exchange
- [cloud resident co creation] ModelBox draws your own painting across the air
- Sequential stack traversal binary tree
- Basic operation of sequence table
- 虚拟化是什么意思?包含哪些技术?与私有云有什么区别?
- 海泰前沿技术|隐私计算技术在医疗数据保护中的应用
- 消息称腾讯正式宣布成立“XR”部门,押注元宇宙;谷歌前 CEO:美国即将输掉芯片竞争,要让台积电、三星建更多工厂...
- gateway
- Prototype mode -- clone monster Army
- Interpreter mode -- formulas for dating
猜你喜欢

How to apply agile development ideas to other work

Bridging mode -- law firm

宅男救不了元宇宙

使用gorm查询数据库时reflect: reflect.flag.mustBeAssignable using unaddressable value

The Google File System (GFS) learning notes

Vant component used in wechat applet

Behind Tiantian Jianbao storm: tens of millions in arrears, APP shutdown, and the founder's premeditated plan to run away?

实现基于Socket自定义的redis简单客户端

When querying the database with Gorm, reflect: reflect flag. mustBeAssignable using unaddressable value

The latest simulated question bank and answers of the eight members (Electrical constructors) of Sichuan architecture in 2022
随机推荐
CVPR 2022缅怀孙剑!同济、阿里获最佳学生论文奖,何恺明入围
The Google File System (GFS) learning notes
CVPR 2022 remembers Sun Jian! Tongji and Ali won the best student thesis award, and hekaiming was shortlisted
Leetcode (146) - LRU cache
虚拟化是什么意思?包含哪些技术?与私有云有什么区别?
在Dialog中使用透明的【X】叉叉按钮图片
Procedural life: a few things you should know when entering the workplace
Ribbon source code analysis @loadbalanced and loadbalancerclient
Basic operation of sequence table
Bean lifecycle flowchart
16 excellent business process management tools
全上链哈希游戏dapp系统定制(方案设计)
Design of routing service for multi Activity Architecture Design
等保备案是等保测评吗?两者是什么关系?
Cooking business experience of young people: bloggers are busy selling classes and bringing goods, and the organization earns millions a month
微信小程序自定义tabBar
对“宁王”边卖边买,高瓴资本“高抛低吸”已套现数十亿
Visitor model -- generation gap between young and middle-aged people
使用gorm查询数据库时reflect: reflect.flag.mustBeAssignable using unaddressable value
maptalks:数据归一化处理与分层设色图层加载