当前位置:网站首页>[postman] collections - run the imported data file of the configuration
[postman] collections - run the imported data file of the configuration
2022-07-06 06:09:00 【lichong951】
You can use data file transfer Postman Value set for use in the collection run . By means of Collection Runner Choose from JSON or CSV Data files , You can test your request with multiple different values in one run .
Use data files to run collections
When you start the collection run , You will see an option to select a data file . choice Postman Right lower corner Runner .
Select your collection , Then select select file next to data on the right to select your data file .
Before you start running , You will see a preview of the data in the file data.json The option to .
[{
"path": "post",
"value": "1"
}, {
"path": "post",
"value": "2"
}, {
"path": "post",
"value": "3"
}, {
"path": "post",
"value": "4"
}]
Select run with data file to start running with the values in the file .
Collection Runner The collection request will be run for each iteration in the data file . The output you see will indicate the results of any tests you defined in the collection request .
Accessing data file values
You can reference the values defined in the data file throughout the request , But access them in the script , You need to use different technologies . To use values in data files in test or pre request script code , Please use iterationData, It provides access to the current data file record used to run the request .
//get the 'value' field from the data file for this request run
pm.iterationData.get("value")
Any data you define in the request will be used by the collection runtime , And your request data can reference the value defined in the data file .
Error reading data file
When Postman When trying to read your data file during the collection run , You may encounter errors . If this happens , You can take the following steps .
Make sure your data file format is correct , by CSV or JSON.
By opening the data file in a text editor and saving the file in a different format , Make sure your data file is encoded correctly .
边栏推荐
- MIT6.s081-2020 Lab2 System Calls
- IP day 16 VLAN MPLS configuration
- LeetCode 732. 我的日程安排表 III
- 曼哈顿距离与曼哈顿矩形-打印回字型矩阵
- LeetCode 731. 我的日程安排表 II
- GTSAM中ISAM2和IncrementalFixedLagSmoother说明
- 如何在业务代码中使用 ThinkPHP5.1 封装的容器内反射方法
- [course notes] Compilation Principle
- Introduction to promql of # yyds dry goods inventory # Prometheus
- Network protocol model
猜你喜欢
随机推荐
ICLR 2022 spotlight | analog transformer: time series anomaly detection method based on correlation difference
Usage of test macro of GTEST
Caused by:org.gradle.api.internal.plugins . PluginApplicationException: Failed to apply plugin
查詢生產訂單中某個(些)工作中心對應的標准文本碼
【论文阅读】NFlowJS:基于鲁棒学习的合成负数据密集异常检测
对数据安全的思考(转载)
【无标题】
(5) Explanation of yolo-v3 core source code (3)
假设检验学习笔记
进程和线程的理解
Cognitive introspection
H3C防火墙RBM+VRRP 组网配置
Eigen稀疏矩阵操作
[Thesis code] SML part code reading
The latest 2022 review of "graph classification research"
公司视频加速播放
Title 1093: character reverse order
Introduction to promql of # yyds dry goods inventory # Prometheus
Raised a kitten
Report on the competition status and investment decision recommendations of Guangxi hospital industry in China from 2022 to 2028