exec(http("/company-sites/:id/details") .get("/company-sites/${sites_id}/details") .check(status.is(200), jsonPath("$.goods[*].id").saveAs("goods_id_list"))) .pause(5) .repeat(10) { exec(http("/company-sites/goods/:id") .get("/company-sites/goods/${goods_id_list.random()}")) .pause(5) }
{"site":{"id":1,"logo":"http://9rentest.oss-cn-hangzhou.aliyuncs.com/images/company/1/1/logo.png!cs-m","address":"西安市碑林区长安北路14号省体育商城B-10号","name":"天意体育场店","lng":108.948993,"lat":34.240027,"tel":"029-85569182","score":5.0},"brands":["http://9rentest.oss-cn-hangzhou.aliyuncs.com/images/brand/yonex-icon.png!b-s","http://9rentest.oss-cn-hangzhou.aliyuncs.com/images/brand/rsl-icon.png!b-s"],"goods":[{"id":8,"name":"林丹限量款短裤","img":"http://9rentest.oss-cn-hangzhou.aliyuncs.com/images/goods/8/cf9d24a6-ceae-4b39-9559-b91a0c509b9e.png!g-m","sellPrice":180.0,"originPrice":258.0,"brandImg":"http://9rentest.oss-cn-hangzhou.aliyuncs.com/images/brand/yonex-logo.png!b-m"},{"id":4,"name":"女款翻领速排汗短袖","img":"http://9rentest.oss-cn-hangzhou.aliyuncs.com/images/goods/4/fcaf296d-fc71-4ccc-af8d-7a5f6e1f7761.png!g-m","sellPrice":180.0,"originPrice":258.0,"brandImg":"http://9rentest.oss-cn-hangzhou.aliyuncs.com/images/brand/yonex-logo.png!b-m"},{"id":7,"name":"林丹限量款短袖","img":"http://9rentest.oss-cn-hangzhou.aliyuncs.com/images/goods/7/1d9e7605-23b8-40db-a3ef-a2513512504f.png!g-m","sellPrice":187.0,"originPrice":268.0,"brandImg":"http://9rentest.oss-cn-hangzhou.aliyuncs.com/images/brand/yonex-logo.png!b-m"},{"id":3,"name":"男款翻领速排汗短袖","img":"http://9rentest.oss-cn-hangzhou.aliyuncs.com/images/goods/3/6625e732-804a-40f7-9dce-3cc1873f67d1.png!g-m","sellPrice":187.0,"originPrice":268.0,"brandImg":"http://9rentest.oss-cn-hangzhou.aliyuncs.com/images/brand/yonex-logo.png!b-m"},{"id":6,"name":"李宗伟奥运限量款短裤","img":"http://9rentest.oss-cn-hangzhou.aliyuncs.com/images/goods/6/081d0fb9-2664-4203-8277-42cddd5431f5.png!g-m","sellPrice":208.0,"originPrice":298.0,"brandImg":"http://9rentest.oss-cn-hangzhou.aliyuncs.com/images/brand/yonex-logo.png!b-m"},{"id":9,"name":"男款圆领速排汗短袖","img":"http://9rentest.oss-cn-hangzhou.aliyuncs.com/images/goods/9/e3ace65e-508d-4a98-9225-bc61b0d4cca1.png!g-m","sellPrice":222.0,"originPrice":318.0,"brandImg":"http://9rentest.oss-cn-hangzhou.aliyuncs.com/images/brand/yonex-logo.png!b-m"}]}
$.goods[*].id
23:11:14.911 [ERROR] i.g.h.a.s.HttpRequestAction - 'httpRequest-19' failed to execute: 8 named 'goods_id_list' does not support .random function
.get("/company-sites/${sites_id_list.random()}/details") .check(status.is(200), jsonPath("$.goods[*].id").findAll.saveAs("goods_id_list")))