当前位置:网站首页>Postman core function analysis - parameterization and test report
Postman core function analysis - parameterization and test report
2022-07-05 19:24:00 【Xiaowu knock code】
1. Parametric processing
A parameterized : For an interface , There are a large number of test data that need to be verified in batch , Changing request parameters one by one is too time-consuming and labor-consuming , It is more efficient to use parameterized batch data processing , The general implementation is through document parameterization .
The first line of information in the file It needs to match the parameter variable
Batch execution
Parameterized assertion
Add assertion data
// Set a variable assert
assert = pm.variables.get("assert");
// break said message word paragraph value by success
pm.test("message The field values for success", function () {
var jsonData = pm.response.json();
pm.expect(jsonData.message).to.eql(assert);
});
2. Postman Generate test reports
Postman Use runner Runtime , The generated report can only be in Postman Inside view , It's not very convenient . So you can generate a HTML The report , Open it through the browser
Postman Need generation HTML Reports need to use newman, With the help of newman Tool generation .
2.1 install newman
newman It's using node.js Development , Specially for postman A tool plug-in for generating test reports . We need to install node.js、newman、newman plug-in unit :newman-reporter-html
download node.js:https://nodejs.org/en/ Proposed installation 15 perhaps 16 edition
npm install -g cnpm –
registry=https://registry.npm.taobao.org install newman: open cmd, Input npm install -g newman
install newman-reporter-html open cmd, Input npm install -g newman-reporter-html
2.2newman The command runs the use case
newman run Use case set .json -e Environmental documents .json -d Data files .json -r html --repoter-html-export report.html
newman run Use case set .json The meaning of running a use case set
-e Environmental documents .json Specify the running environment
-d Data files .json Specify the data to run
-r html Generate html The report
–reporter-html-export report.html Appoint html Report name is report.html
You need to export the script before execution / Data files / Environment files such as :
newman run token.postman_collection.json -d logindata.txt -e pinter project .postman_environment.json -n 3 -r html --reporter-html-export .\
After execution, the directory generates a report file
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
边栏推荐
- Shell编程基础(第8篇:分支语句-case in)
- Pandora IOT development board learning (HAL Library) - Experiment 8 timer interrupt experiment (learning notes)
- 【AI 框架基础技术】自动求导机制 (Autograd)
- HiEngine:可媲美本地的云原生内存数据库引擎
- uniapp获取微信头像和昵称
- S7-200SMART利用V90 MODBUS通信控制库控制V90伺服的具体方法和步骤
- Necessary skills for interview in large factories, 2022android will not die, I will not fall
- Ultrasonic ranging based on FPGA
- JS solution force deduction daily question (12) - 556 Next larger element III (2022-7-3)
- MMO項目學習一:預熱
猜你喜欢
Bitcoinwin (BCW)受邀参加Hanoi Traders Fair 2022
全网最全的低代码/无代码平台盘点:简道云、伙伴云、明道云、轻流、速融云、集简云、Treelab、钉钉·宜搭、腾讯云·微搭、智能云·爱速搭、百数云
华为让出的高端市场,小米12S靠徕卡能抢到吗?
S7-200SMART利用V90 MODBUS通信控制库控制V90伺服的具体方法和步骤
What are the reliable domestic low code development platforms?
618“低调”谢幕,百秋尚美如何携手品牌跨越“不确定时代”?
IBM has laid off 40 + year-old employees in a large area. Mastering these ten search skills will improve your work efficiency ten times
【obs】QString的UTF-8中文转换到blog打印 UTF-8 char*
How to realize the Online timer and offline timer in the game
UWB超宽带定位技术,实时厘米级高精度定位应用,超宽带传输技术
随机推荐
Ten years at sea: old and new relay, dark horse rising
MMO project learning 1: preheating
Reinforcement learning - learning notes 4 | actor critical
【AI 框架基础技术】自动求导机制 (Autograd)
Django使用mysqlclient服务连接并写入数据库的操作过程
Hiengine: comparable to the local cloud native memory database engine
Common - Hero Minesweeper
acm入门day1
出海十年:新旧接力,黑马崛起
JAD的安装、配置及集成IDEA
Information / data
建议收藏,我的腾讯Android面试经历分享
Postman核心功能解析-参数化和测试报告
JMeter 常用的几种断言方法,你会了吗?
手机开户选择哪家券商公司比较好哪家平台更安全
Fuzor 2020 software installation package download and installation tutorial
HiEngine:可媲美本地的云原生内存数据库引擎
软件测试是干什么的?学习有啥要求?
That's awesome. It's enough to read this article
Debezium系列之:IDEA集成词法和语法分析ANTLR,查看debezium支持的ddl、dml等语句