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

边栏推荐
- Precautions for RTD temperature measurement of max31865 module
- 使用文件和目录属性和属性
- Powerful tool for collection processing
- Interprocess communication (IPC): shared memory
- XML基础知识概念
- lombok @Builder注解
- Summary of six points of MySQL optimization
- 在通达信上做基金定投安全吗?
- c期末复习
- Icml2022 | partial and asymmetric comparative learning of out of distribution detection in long tail recognition
猜你喜欢

中文版Postman?功能真心强大!

UDF implementation of Dameng database

AI表现越差,获得奖金越高?纽约大学博士拿出百万重金,悬赏让大模型表现差劲的任务

Shang Silicon Valley Shang preferred project tutorial release

达梦数据库udf实现

@Extension, @spi annotation principle

Word finds red text word finds color font word finds highlighted formatted text

自动化测试的好处

Rse2020/ cloud detection: accurate cloud detection of high-resolution remote sensing images based on weak supervision and deep learning

企业数字化转型之路,从这里开始
随机推荐
What are the cache interfaces of nailing open platform applet API?
C language makes it easy to add, delete, modify and check the linked list "suggested collection"
技术分享 | 接口测试价值与体系
sample_rate(采樣率),sample(采樣),duration(時長)是什麼關系
Memory leak of viewpager + recyclerview
2022 latest Android interview written examination, an Android programmer's interview experience
MySQL优化六个点的总结
7-2 keep the linked list in order
Cronab log: how to record the output of my cron script
c期末复习
Emqx 5.0 officially released: a single cluster supports 100million mqtt connections
如何写出好代码 - 防御式编程
AI表现越差,获得奖金越高?纽约大学博士拿出百万重金,悬赏让大模型表现差劲的任务
2022最新中高级Android面试题目,【原理+实战+视频+源码】
Overview of video self supervised learning
输油管的布置数学建模matlab,输油管布置的数学模型
A2L file parsing based on CAN bus (3)
Find in MySQL_ in_ Detailed explanation of set() function usage
How to write good code defensive programming
Take a look at semaphore, the current limiting tool provided by JUC