当前位置:网站首页>Interface test tool postman
Interface test tool postman
2022-06-30 03:42:00 【smallfish118】
Believed to have been used postman Tool's little partner , Yes postman It's hard to avoid love , Four words describe : Simple, practical, generous and beautiful !
Limited to my ability , This article is not teaching , Is only postman In use , Summarize and share the important knowledge points . So here are some scattered knowledge points .
Teamwork
Use postman When writing interface use cases , Certainly not without teamwork .postman Not using regular version management tools git/svn Version management , It's through your own Workspaces Conduct management .
1. Add team members
Home You can also add... To the directory team Members of the , But it cannot be edited Role, Therefore, it is suggested that workspaces Add under directory . In general , Only the test team leader is Admin, Other team members are Editor.
It should be noted that ,postman The team member free version currently only allows 3 personal .
2. version control

summary
Pulling branches will not be repeated here , The reason is simple , Because the possibility of using is almost zero . After all, when writing test cases , It is almost impossible to require several people to work together to write a requirement use case .
Create a branch —— Write interface test cases —— Merging branches .
Variable scope
Use postman It must be necessary to use variables , A core knowledge point in variables is scope .
Global: Available throughout the workspace
Collection: Available throughout the request in the collection , And it has nothing to do with the environment
Environment: Only one environment can be used at a time
Data: From the outside csv and json file , Used to define passage Newman or Collection Runner The dataset used to run the collection . It is used for data-driven
Local: Temporary variable , Only scope the respective script areas , namely pre/test When scripting ,local Only scope this script

Above , Namely postman Usage of all variables provided , The importance of variable scope is self-evident ,global>collection>environment>data>local, It must be kept in mind .
It is easy to use variables in a script ,get obtain ,set to update / newly added , I won't repeat it here . Need to pay attention to ,postman yes node.js Developed , The script is also js Script , So we need to have some js Basics . for example :response Get variables in ( from json Get the specified key Corresponding value); Type conversion ; Function writing and promise And so on .
summary
global Avoid using , If there is a constant for the whole project, you can set it , It is recommended to use uppercase variable names ;collection Act on the set , This one is used more , This variable is generally used for data transfer between interfaces ;environment Commonly used in url Set up ;data Is used for data-driven use case execution ;local Is used for some intermediate variables during script writing .
workflow
Write use cases , It is not possible to write use cases that are limited to a single interface , The writing of scenario use cases cannot be bypassed .postman Provide setNextRequest Build the process .
summary
Although this knowledge point only involves a function , But it's really important . at present postman The latest version has been provided flows Visual editing , Once again, it's lower postman The threshold of entry . But it seems that because it is the first edition , Logical judgment cannot be realized ,postman There are no official tutorials , So for the time being, use setNextRequest better .
monitor
If you choose postman Interface automation , The industry generally uses newman+jenkins Solutions for , The advantages of this scheme are self-evident , Can really realize devops. and newman Simple understanding , Namely postman Command line execution script for , I won't introduce it here , After all newman Is a set of instructions , I need to recite .Postman It also comes with a set of monitoring , But it didn't work jenkins Automatic build and automatic deployment of , So it can only realize the automatic execution of use cases .
This free version is only available for one week 300 Time request call , Therefore, it is difficult to do interface automation at the company level without paying run Of .
summary :
It can be used as a set of solutions to realize interface automation .
The final chapter
That's how individuals respond to postman Use summary ,postman As an interface testing tool , The humanization is excellent , The latest version has been released flows function , Reduce the user's use cost again . however postman Compared with another interface testing tool jmeter for , The disadvantages are obvious , Unable to perform performance test , After all postman Only the configuration of the number of iterations is provided , Can not be like jmeter Configure more performance parameters . Automation , Use newman+jenkins To realize interface automation , This is very mature , It is suggested that it can be popularized in the company . But I have to say , because postman The technology stack is javascript, Different from the conventional technical stack of testers python/java, So it is really popularized , There is still considerable resistance .PS:postman There is another function ,mock server, But it's not used much in practice , After all, everyone mock The usage habit is also a professional packet capturing tool fiddler/charles, So this function is not introduced here .
边栏推荐
- Tidb 6.0: rendre les GRT plus efficaces 丨 tidb Book Rush
- SDS understanding in redis
- The 5-year Android development interview took 20 days to join Alibaba
- 【云原生】AI云开发平台——AI Model Foundry介绍(开发者可免费体验AI训练模型)
- dotnet-exec 0.5.0 released
- [0x0] open questions left by the principal
- UML diagrams and list collections
- 实用调试技巧
- C#【高级篇】 C# 匿名方法【待补充Lambda表达式。。。】
- Mysql性能优化(5):主从同步原理与实现
猜你喜欢

51 single chip microcomputer indoor environment monitoring system, mq-2 smoke sensor and DHT11 temperature and humidity sensor, schematic diagram, C programming and simulation

QT中foreach的使用

Redis is used in Windows system
![C # [advanced part] C # multithreading](/img/16/2a7c477b4cee32d9ce1e543c9d4c7e.png)
C # [advanced part] C # multithreading

Hash design and memory saving data structure design in redis

Redis中的SDS理解

专升本高数(四)

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

【笔记】2022.6.7 数据分析概论
![[Note] ab Test and Variance Analysis](/img/f2/58369a99514d37d5af335a61d0911f.jpg)
[Note] ab Test and Variance Analysis
随机推荐
[punch in - Blue Bridge Cup] day 5 --- lower() small
MySQL performance optimization (6): read write separation
[0x0] 校长留的开放问题作业
【力扣刷题总结】数据库题目按知识点分类总结(持续更新/简单和中等题已完结)
laravel9本地安裝
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
产品思维 | 无人机快递的未来值得期待吗?
[wechat applet] how did the conditional rendering list render work?
【笔记】2022.5.27 通过pycharm操作MySQL
X Book 6.97 shield unidbg calling method
华为云原生——数据开发与DataFactory
C#【高级篇】 C# 接口(Interface)
[operation] MySQL query operation 2 on May 25, 2022
MySQL + JSON = King fried
Global and Chinese market for sensor screwdrivers 2022-2028: Research Report on technology, participants, trends, market size and share
2021-07-05
Chapter 2 control structure and function (programming problem)
Redis is used in Windows system
dotnet-exec 0.5.0 released
[operation] write CSV to database on May 28, 2022