当前位置:网站首页>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-htmlopen 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 …….

边栏推荐
- SAP feature description
- China law network joins hands to observe the cloud, and the online system is a full link observable platform
- 2022 Alibaba Android advanced interview questions sharing, 2022 Alibaba hand Taobao Android interview questions
- Tupu software digital twin smart wind power system
- websocket 工具的使用
- Technology sharing | interface testing value and system
- Word finds red text word finds color font word finds highlighted formatted text
- Idea configuring NPM startup
- 案例分享|金融业数据运营运维一体化建设
- The worse the AI performance, the higher the bonus? Doctor of New York University offered a reward for the task of making the big model perform poorly
猜你喜欢

UDF implementation of Dameng database

Oracle Chinese sorting Oracle Chinese field sorting

Shang Silicon Valley Shang preferred project tutorial release

深入底层C源码讲透Redis核心设计原理

Use of websocket tool

You can have both fish and bear's paw! Sky wing cloud elastic bare metal is attractive!

U-Net: Convolutional Networks for Biomedical Images Segmentation

Reading notes of Clickhouse principle analysis and Application Practice (5)

How to automatically install pythn third-party libraries

5. 数据访问 - EntityFramework集成
随机推荐
RedHat7.4配置yum软件仓库(RHEL7.4)
Memory leak of viewpager + recyclerview
案例分享|金融业数据运营运维一体化建设
Postman核心功能解析 —— 参数化和测试报告
如何写出好代码 - 防御式编程
CDB 实例的启动与关闭
鱼和熊掌可以兼得!天翼云弹性裸金属一招鲜!
[detailed explanation of AUTOSAR 14 startup process]
Find in MySQL_ in_ Detailed explanation of set() function usage
Oracle日期格式转换 to_date,to_char,to_timetamp 相互转换
Cronab log: how to record the output of my cron script
跨境支付平台 XTransfer 的低代码实践:如何与其他中台融合是核心
How to write good code defensive programming
Technology sharing | interface testing value and system
IDEA配置npm启动
7-2 保持链表有序
爬虫01-爬虫基本原理讲解
Is it safe to make fund fixed investment on access letter?
2022 latest Android interview written examination, an Android programmer's interview experience
蚂蚁集团开源可信隐私计算框架「隐语」:开放、通用