Postman生成随机数(4)

1.使用背景

在使用Postman测试接口的过程中,部分值如电话号码,不能总用一个值,所以我们的随机数就有了很大作用。

2.可以使用的随机数变量

 

 3.应用

 

1  //设置当前时间戳
2 postman.setGlobalVariable("timestamp",Math.round(new Date().getTime()));
3 timestamp = postman.getGlobalVariable('timestamp');

 

posted @ 2021-07-02 16:27  缘来似你  阅读(1376)  评论(0编辑  收藏  举报