1.比如创建任务,每次都需要一个name,而且不可重复,可以random随机生成name,作为前置脚本
使用:"name": "${job_name}",
//name now_time = DateFormatUtils.format(new Date(), "yyyyMMdd_HHmmss_SSS"); random_number = RandomUtils.nextInt(0, 1000000); affix = now_time + "_" + random_number; job_name = "my_" + affix; context.put("job_name", job_name);
2.例子:post,/datatester/metric/api/v3/apps/46/conclusion_report_bundle,包含参数
3.出参:$.response.data.data.id
4.断言:响应码校验${$.response.code}200、字段校验${$.response.data.code}0
postman其实用法一样,
标签:name,random,number,接口,job,测试用例,自动化,data,response From: https://www.cnblogs.com/chuting/p/18307879