当前位置:网站首页>Postman learning sharing
Postman learning sharing
2022-06-30 03:41:00 【smallfish118】
postman yes node.js Developed , Provided api All of them are javascript, So I want to use it well postman,javascript Basic grammar is a must
Variable
global>collection>environment>data>local>temporary
global
Global variables , Please use this with caution , I haven't used this variable yet
collection
This can be used to edit our business variables , adopt set Set up ,get obtain
body Can be used in { {variable_key}} obtain , But in script It can't be used in this way , You have to use get To get
environment
Gu Ming thinks about , environment variable , It's used to distinguish the environment . Normally used for configuration url Differentiate the environment
data
DDT Use when driving tests
local
This scope is used throughout the interface script , That is, if you are in pre-request script in set Definition , It's in body、test、headers You can use
temporary
This is javascript Use defined in , But only in the specified script . It can be understood in this way , Every script is a function, All defined variables , Limited to function Use in
Dynamic variables
Method used :pm.variables.replaceIn('{ {$randomFirstName}}')
Specific dynamic variables need to be queried by themselves postman Official website
Assertion
pm.test(' Prompt information ', () => {
pm.expect(var0).to.not.eql(var1);
})pm All assertions are soft assertions , In fact, it should be based on js To understand , Because it's asynchronous , So the main process will not be blocked , If you want to use hard assertions ( Block the whole collection runner, It is not possible to implement a single use case break), You can use it directly pm.expect
Execution flow
postman.setNextRequest(' The basic information of the selector is reviewed and submitted by the editor ');
postman Only this method is provided , It should be noted that , This method doesn't matter where you put it in the use case , This is executed at the end of the use case .
In addition to giving name, Can also give id,id Get it in the following way

That's what I've learned so far , Follow up
边栏推荐
- [wechat applet] how did the conditional rendering list render work?
- Redis high concurrency distributed locks (learning summary)
- [Note] ab Test and Variance Analysis
- 第2章 控制结构和函数(编程题)
- Huawei interview question: tall and short people queue up
- I have published a book, "changing life against the sky - the way for programmers to become gods", which is open source. I have been working for ten years. There are 100 life suggestions from technica
- December2020 - true questions and analysis of C language (Level 2) in the youth level examination of the Electronic Society
- If you can tell whether the external stock index futures trading platform I am trading is formal and safe?
- 2021-07-05
- Openssl3.0 learning 22 provider decoder
猜你喜欢

How to view Tencent's 2022 school recruitment salary, the total contract of cabbage is 40W?

1151_ Makefile learning_ Static matching pattern rules in makefile

NER中BiLSTM-CRF解读score_sentence

(04).NET MAUI实战 MVVM

124 articles in total! Motianlun "high availability architecture" dry goods document sharing (including Oracle, mysql, PG)

Redis高并发分布式锁(学习总结)

Learning cyclic redundancy CRC check

产品思维 | 无人机快递的未来值得期待吗?

Mysql性能优化(5):主从同步原理与实现

unity input system 使用记录(实例版)
随机推荐
[punch in - Blue Bridge Cup] day 1 --% 7F format output
云原生——Web实时通信技术之Websocket
C # [advanced part] C # multithreading
Feign 坑
4-5 count words and spaces (15 points)
云原生入门+容器概念介绍
MySQL + JSON = King fried
hudi记录
C#【高级篇】 C# 多线程
C#【高级篇】 C# 接口(Interface)
2021-07-05
Are you a "social bull" or a "social terrorist" in the interview?
1150_ Makefile learning_ Duplicate name target processing in makefile
Play with algorithm interview together, nanny level strategy (with high-definition codeless algorithm summary map), recommended collection
X Book 6.97 shield unidbg calling method
第2章 控制结构和函数(编程题)
Number of students from junior college to Senior College (4)
毕业设计EMS办公管理系统(B/S结构)+J2EE+SQLserver8.0
Global and Chinese markets for active transdermal drug delivery devices 2022-2028: Research Report on technology, participants, trends, market size and share
UML图与List集合