当前位置:网站首页>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
边栏推荐
- 你清楚AI、数据库与计算机体系
- Global and Chinese market for sensor screwdrivers 2022-2028: Research Report on technology, participants, trends, market size and share
- Hudi record
- Integrating viewbinding and viewholder with reflection
- 【论文阅读|深读】DANE:Deep Attributed Network Embedding
- Tidb 6.0: rendre les GRT plus efficaces 丨 tidb Book Rush
- UML图与List集合
- 【论文阅读|深读】Role2Vec:Role-Based Graph Embeddings
- 专升本语文资源整理
- Global and Chinese market for nasal drug delivery devices 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢

SDS understanding in redis
![[wechat applet] how did the conditional rendering list render work?](/img/db/4e79279272b75759cdc8d6f31950f1.png)
[wechat applet] how did the conditional rendering list render work?

Redis high concurrency distributed locks (learning summary)

C#【高级篇】 C# 多线程
![[ten minutes] manim installation 2022](/img/54/7b895d785c7866271f06ff49cb20aa.png)
[ten minutes] manim installation 2022

TiDB 6.0:讓 TSO 更高效丨TiDB Book Rush

laravel9本地安裝

深入浅出掌握grpc通信框架
![[punch in - Blue Bridge Cup] day 5 --- lower() small](/img/b5/21f51a7416c72c299cc59192a33b3a.jpg)
[punch in - Blue Bridge Cup] day 5 --- lower() small

Usage record of unity input system (instance version)
随机推荐
Global and Chinese market for sensor screwdrivers 2022-2028: Research Report on technology, participants, trends, market size and share
[note] May 23, 2022 MySQL
[operation] getting started with MySQL on May 23, 2022
dotnet-exec 0.5.0 released
Use common fileUpload to upload files
你清楚AI、数据库与计算机体系
Tidb 6.0: making Tso more efficient tidb Book rush
Mathematical solution of Joseph Ring
C # [advanced part] C # multithreading
Mysql性能优化(5):主从同步原理与实现
[punch in - Blue Bridge Cup] day 2 --- format output format, ASCII
[operation] MySQL query operation 2 on May 25, 2022
[wechat applet] how did the conditional rendering list render work?
unity input system 使用记录(实例版)
Neo4j--- performance optimization
Neo4j---性能优化
A minimalist way to integrate databinding into activity/fragment
How do college students make money by programming| My way to make money in College
Laravel9 installation locale
产品思维 | 无人机快递的未来值得期待吗?