文章目录 目的解决方案 目的 为了解决 postman 传参数据定制化,需要写一点前置脚本,有用到随机选取数组中的值来造数据。 解决方案 // 随机数组函数 function getRandomNumber(arr) {return arr[Math.floor(Math.random() * arr.length)]; }