当前位置:网站首页>Postman pre request
Postman pre request
2022-06-29 07:42:00 【Wang dada】
Using dynamic variables
Method 1 :
Reference timestamp variables :{ {$timestamp}} The parameters of the request can be generated dynamically
Method 2 :{ {$randomInt}}:0 To 1000 Random integer between
Method 3 :{ {$guid}} :v4 Styling guid Generate similar d1a78ce0-757a-4cd6-91e5-15ca1b340dc7 This random value , More random 
Get request parameters , Preprocessing

evn_username Variable in Pre-request-Script The script defines
// Get the timestamp
var timestrip = Math.round(new Data()/1000).toString()
console.log(timestrip);
// Set the environment variable evn_username Value
pm.environment.set("evn_username",'test'_Math.round(new Date()/1000));
Commonly used Pre-request Script Code
// Clear global variables
pm.globals.unset("variable_key");
// Clear environment variables
pm.environment.unset("variable_key");
// Get global variables
pm.globals.get("variable_key");
// Get a variable
pm.variable.get("variable_key");
// Get environment variables
pm.environment.get("variable_key");
// Send a request
pm.sendRequest("https://postman-echo.com/get",function(err,response){
console.log(response.json());});
// Set the environment variable
pm.globals.set("variable_key","variable_value");
Can be generated directly on the right 
边栏推荐
- 帆船动力学仿真分析
- The table cannot be vacuumed because the cursor is open for a long time
- Machine learning notes - time series prediction using machine learning
- 如何给下属进行授权?
- jmeter 用beanshell导入自己jar包老是查找不到
- How to talk about salary correctly in software test interview?
- 软件测试鸾音鹤信
- from xx import*等价于from xx import *,不一定要加空格
- 机器学习笔记 - 时间序列的混合模型
- tf.to_int64
猜你喜欢
随机推荐
Machine learning notes - time series prediction using machine learning
Mmclassification installation and debugging
测试人员需要了解的工具有哪些
帆船动力学仿真分析
MIPS instruction set and brief analysis
How to authorize subordinates?
tf.compat.v1.assign
[FreeRTOS] interrupt mechanism
TREE ALV 展开Node或者点击Toolbar按钮时DUMP(CL_ALV_TREE_BASE==============CP|SET_ITEMS_FOR_COLUMN)
面试官:为什么数据库连接很消耗资源,资源都消耗在哪里?
Alicloud access resource: nosuchkey
How to view software testing training? Do you need training?
Blue Bridge Cup - minimum frame
【工控老马】PLC六路抢答器系统设计详解
Appium automation test foundation ADB common commands (III)
How to select CRM brand suppliers in garment industry?
ShapeShifter: Robust Physical Adversarial Attack on Faster R-CNN Object Detector
机器学习笔记 - 时间序列使用机器学习进行预测
KingbaseES 中select distinct on 语句
How to solve the cross domain problem of mobile phone accessing the web in the web development scenario









![[FreeRTOS] interrupt mechanism](/img/ab/9b1d07048b4631d7cc95db99ed529a.png)