亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Postman內(nèi)建變量常用方法實(shí)例解析

 更新時(shí)間:2020年07月28日 11:24:40   作者:安琪兒一直在  
這篇文章主要介紹了Postman內(nèi)建變量常用方法實(shí)例解析,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下

一、Postman有以下內(nèi)建變量,適合一次性使用:

{{$guid}}//生成GUID
{{$timestamp}}//當(dāng)前時(shí)間戳
{{$randomInt}}//0-1000的隨機(jī)整數(shù)

二、內(nèi)建變量的應(yīng)用舉例,獲取當(dāng)前時(shí)間戳

// 隨機(jī)整數(shù)
const randomInt = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min; 
pm.globals.set("random_number", randomInt(300,1000));
 

//從多個(gè)選項(xiàng)中選擇實(shí)現(xiàn):
const randomInt = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min; 
const getRandomValue = list => list[randomInt(0, list.length - 1)];
const charsInName = ['王','李','張'];
pm.globals.set("people_name", getRandomValue(charsInName));

//隨機(jī)生成手機(jī)號(hào)
const randomInt = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min; 
var mobile_num= `18${randomInt(100000000, 999999999)}`;
pm.globals.set("mobile_num", mobile_num);

//等待
const sleep = (milliseconds) => {
const start = Date.now();
while (Date.now() <= start + milliseconds) {}
};
sleep(5000)  //5秒

以上就是本文的全部內(nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論