当前位置:网站首页>5、 Basic composition & assertion of JMeter script
5、 Basic composition & assertion of JMeter script
2022-07-18 13:28:00 【Proud cat sauce】
One 、 jmeter The basic composition of the script
In pressure measurement , The composition of a basic script , Need two parts .
- Sampler ( Such as http request )
- Assertion
In the course of debugging , You can add a result tree , In the actual pressure measurement process , need Kill the fruit tree .
In the course of debugging , You can add aggregate reports , In the actual pressure measurement process , You can not add an aggregation report .
Because we are executing the run script command ,
sh jmeter -n -t /Users/a57/ The weather .jmx -l /Users/a57/3.jtl -e -o /Users/a58/cs2/Will automatically generate a format of jtl Aggregate report for .
Add or not add , Little impact on performance .
Any component , Will affect performance , We should use as few components as possible .
Two 、 Response assertion
Add response assertion
Right click http request -》 add to -〉 Assertion -》 Response assertion .
There are many kinds of assertions , Generally, response assertion is enough .

Scope Apply to:
1、 Main request and sub request
2、 The Lord asked
3、 Sub request
4、 Customize
The default selection is 2 The Lord asked Main sample only.
The location of the assertion :

It is generally configured in the response text .( Generally, the response code is not set as an assertion , Because the response code 200 It only means that the request is sent and received normally , It does not mean that the business logic of this interface is normal )
Matching mode :

General choices include .
Add assertion content :

You can add multiple assertions .
After adding assertions , Execute the script , View the result tree , If you are not reminded to report an error , That is the result of assertion , Only when the assertion fails , There will be a hint .
2.1 Be careful :
Not every interface needs assertions , Because assertion processing , It will consume the performance of our press .
We can use other means , Instead of adding assertions , Determine whether the interface is successfully executed .
Type 1 : Write to database / Insert /update/ Deleted interface
test plan , Write 10000 pieces of data to the database . We can go to the database , Check how many entries are actually written , The success rate is obtained by comparison .
General success rate requirements 99%, The more strict requirement is that the success rate is 99.9%.
There is no need to view data in real time / Comparative data . After executing the script , Just look at the data in a unified way .
Query interface , You can only add assertions .
边栏推荐
- u盘删除的文件怎么恢复
- Zhinar observation: what signal did Hongyan Construction Expo release when it launched the whole scene intelligent solution
- Halcon 3D 常见算子描述
- 模板_欧氏筛_素数
- 群晖7.1使用SHR添加硬盘
- Summary of various parameters of ultra micro motherboard
- Working people working soul! Here comes the sales analysis case!
- USB 协议 (一)
- MySQL triggers and stored procedures
- EXCEL图表的绘制的一些注意点
猜你喜欢
随机推荐
Thesis reading: Pyramid scene parsing network
Go: 关于 gRPC
模板_欧氏筛_素数
进程的状态
Zhinar observation: what signal did Hongyan Construction Expo release when it launched the whole scene intelligent solution
剑指 Offer 42. 连续子数组的最大和
Mysql5.7 create user error: error 1364 (HY000): field 'SSL_ Cipher 'doesn't have a default value solution
Work method record
【软件测试】08 -- 黑盒测试方法(边界值分析法、因果图与决策表法)
Aomei Easy clone system disk backup
static变量看着有点晕,gdb汇编清醒清醒
【机器学习】集成学习 - Ensemble Learning
[RT thread] NXP rt10xx sfud and fal component construction and use
剑指 Offer 32 - II. 从上到下打印二叉树 II for_in range()
HMS core graphics and image technology shows the latest functions and application scenarios, and accelerates the construction of digital intelligence life
Community summit pulsar summit old golden peak conference topic highlights exposure!
MulterError: Unexpected field
[machine learning] random forest
剑指 Offer 26. 树的子结构
剑指 Offer 32 - I. 从上到下打印二叉树,广度优先搜索(队列)








