当前位置:网站首页>Analysis of postman core functions - parameterization and test report
Analysis of postman core functions - parameterization and test report
2022-07-05 18:56:00 【Little brother said test】
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 .
create a file Format CSV
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, Inputnpm 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 , Watching the rise and attention of fans all the way , Reciprocity is always necessary , Although it's not very valuable , If you can use it, you can take it
These materials , For those engaged in 【 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 …….
边栏推荐
- lombok @Builder注解
- 输油管的布置数学建模matlab,输油管布置的数学模型
- Emqx 5.0 officially released: a single cluster supports 100million mqtt connections
- 5. 数据访问 - EntityFramework集成
- Interprocess communication (IPC): shared memory
- Thoroughly understand why network i/o is blocked?
- Case sharing | integrated construction of data operation and maintenance in the financial industry
- Use QT to traverse JSON documents and search sub objects
- Overview of video self supervised learning
- China law network joins hands to observe the cloud, and the online system is a full link observable platform
猜你喜欢
RedHat7.4配置yum软件仓库(RHEL7.4)
How much does the mlperf list weigh when AI is named?
MySQL数据库索引教程(超详细)
图扑软件数字孪生 | 基于 BIM 技术的可视化管理系统
跨境支付平台 XTransfer 的低代码实践:如何与其他中台融合是核心
Solutions contents have differences only in line separators
爬虫01-爬虫基本原理讲解
FCN: Fully Convolutional Networks for Semantic Segmentation
Isprs2020/ cloud detection: transferring deep learning models for cloud detection between landsat-8 and proba-v
Tianyi cloud understands enterprise level data security in this way
随机推荐
Powerful tool for collection processing
Postman核心功能解析 —— 参数化和测试报告
Quickly generate IPA package
鱼和熊掌可以兼得!天翼云弹性裸金属一招鲜!
【历史上的今天】7 月 5 日:Google 之母出生;同一天诞生的两位图灵奖先驱
The easycvr authorization expiration page cannot be logged in. How to solve it?
【Autosar 十四 启动流程详解】
集合处理的利器
Ant group open source trusted privacy computing framework "argot": open and universal
Overview of video self supervised learning
ICML2022 | 长尾识别中分布外检测的部分和非对称对比学习
图扑软件数字孪生智慧风电系统
基于can总线的A2L文件解析(3)
快速生成ipa包
How to choose the most formal and safe external futures platform?
2022全网最全的腾讯后台自动化测试与持续部署实践【万字长文】
[HCIA cloud] [1] definition of cloud computing, what is cloud computing, architecture and technical description of cloud computing, Huawei cloud computing products, and description of Huawei memory DD
The main thread anr exception is caused by too many binder development threads
Oracle 中文排序 Oracle 中文字段排序
Summary of six points of MySQL optimization