当前位置:网站首页>Postman core function analysis - parameterization and test report
Postman core function analysis - parameterization and test report
2022-07-06 06:19:00 【The elegance of testing】
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, 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

Last : It can be in the official account : Sad spicy bar ! Get one by yourself 216 Page software testing engineer interview guide document information 【 Free of charge 】. And the corresponding video learning tutorial is free to share !, It includes basic knowledge 、Linux necessary 、Shell、 The principles of the Internet 、Mysql database 、 Special topic of bag capturing tools 、 Interface testing tool 、 Test advanced -Python Programming 、Web automated testing 、APP automated testing 、 Interface automation testing 、 Testing advanced continuous integration 、 Test architecture development test framework 、 Performance testing 、 Safety test, etc. .
I recommend one 【Python Automated test communication group :746506216】, We can discuss communication software testing together , Learn software testing together 、 Interview and other aspects of software testing , Help you advance quickly Python automated testing / Test Development , On the road to high pay .
Friends who like software testing , If my blog helps you 、 If you like my blog content , please “ give the thumbs-up ” “ Comment on ” “ Collection ” One Key triple connection !
边栏推荐
- Simulation volume leetcode [general] 1143 Longest common subsequence
- E - 食物链
- Simulation volume leetcode [general] 1447 Simplest fraction
- [eolink] PC client installation
- Hypothesis testing learning notes
- Qt:无法定位程序输入点XXXXX于动态链接库。
- 模拟卷Leetcode【普通】1296. 划分数组为连续数字的集合
- How to extract login cookies when JMeter performs interface testing
- Database isolation level
- Manage configuration using Nacos
猜你喜欢

Nodejs realizes the third-party login of Weibo

Database isolation level

oscp raven2靶机渗透过程
![[postman] collections configuration running process](/img/09/bcd9fd6379fa724671ffd09278442e.png)
[postman] collections configuration running process

Technology sharing | common interface protocol analysis

使用Nacos管理配置
![Buuctf-[gxyctf2019] no dolls (xiaoyute detailed explanation)](/img/0a/054b994b29d4c50ede8b23514cf4ee.jpg)
Buuctf-[gxyctf2019] no dolls (xiaoyute detailed explanation)
![[C language] string left rotation](/img/5f/66bcc8f992108bf3b7e455709d3174.png)
[C language] string left rotation

MySQL之基础知识

LeetCode 729. 我的日程安排表 I
随机推荐
黑猫带你学UFS协议第8篇:UFS初始化详解(Boot Operation)
G - Supermarket
【Postman】Collections-运行配置之导入数据文件
黑猫带你学UFS协议第4篇:UFS协议栈详解
[C language] string left rotation
F - True Liars (种类并查集+DP)
[API interface tool] Introduction to postman interface
Simulation volume leetcode [general] 1062 Longest repeating substring
调用链监控Zipkin、sleuth搭建与整合
模拟卷Leetcode【普通】1091. 二进制矩阵中的最短路径
Simulation volume leetcode [general] 1447 Simplest fraction
使用Nacos管理配置
ESP32 ESP-IDF看门狗TWDT
How to extract login cookies when JMeter performs interface testing
Thoughts on data security (Reprint)
win10无法操作(删除、剪切)文件
模拟卷Leetcode【普通】1296. 划分数组为连续数字的集合
对数据安全的思考(转载)
测试周期被压缩?教你9个方法去应对
通过修改style设置打印页样式