当前位置:网站首页>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 …….
边栏推荐
- Pytorch yolov5 training custom data
- websocket 工具的使用
- The easycvr authorization expiration page cannot be logged in. How to solve it?
- EMQX 5.0 正式发布:单集群支持 1 亿 MQTT 连接
- [detailed explanation of AUTOSAR 14 startup process]
- 深入底层C源码讲透Redis核心设计原理
- vs2017 qt的各种坑
- c期末复习
- 《ClickHouse原理解析与应用实践》读书笔记(5)
- LeetCode 6109. 知道秘密的人数
猜你喜欢
How to automatically install pythn third-party libraries
Oracle Chinese sorting Oracle Chinese field sorting
LeetCode 6111. Spiral matrix IV
Word查找红色文字 Word查找颜色字体 Word查找突出格式文本
[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
【Autosar 十四 启动流程详解】
2022年阿里Android高级面试题分享,2022阿里手淘Android面试题目
Thoroughly understand why network i/o is blocked?
Pytorch yolov5 training custom data
Solutions contents have differences only in line separators
随机推荐
2022 Alibaba Android advanced interview questions sharing, 2022 Alibaba hand Taobao Android interview questions
Thoroughly understand why network i/o is blocked?
Reptile 01 basic principles of reptile
为什么 BI 软件都搞不定关联分析?带你分析分析
C final review
Exemple Quelle est la relation entre le taux d'échantillonnage, l'échantillon et la durée?
小程序 修改样式 ( placeholder、checkbox的样式)
蚂蚁集团开源可信隐私计算框架「隐语」:开放、通用
图扑软件数字孪生 | 基于 BIM 技术的可视化管理系统
What are the cache interfaces of nailing open platform applet API?
2022最新中高级Android面试题目,【原理+实战+视频+源码】
SAP 特征 特性 说明
视频自监督学习综述
RedHat7.4配置yum软件仓库(RHEL7.4)
Windows Oracle 开启远程连接 Windows Server Oracle 开启远程连接
c期末复习
Reading notes of Clickhouse principle analysis and Application Practice (5)
中文版Postman?功能真心强大!
Isprs2022/ cloud detection: cloud detection with boundary nets
关于服装ERP,你想知道的都在这里了