一旦响应在jmeter中具有正确的值,只需执行API一次,

uxhixvfz  于 2022-12-13  发布在  其他
关注(0)|答案(1)|浏览(125)

For the ride bookin app i need to stop the execution of 'End Ride' api once i receive the status as 'COMPLETED' in response.Currently I am using while controller but that enters infinite loop. API Response: {"id":3820,"status":"COMPLETED","rider":{"id":2019,"firstname":"test","lastname":"rider","phoneNumber":"9000000124","email":"Test_rider_10002@popp1.com","rating":5.0,"user":{},"fullName":"test rider"},"startLocationLat":36.10805389068134,"startLocationLong":-115.16570490025539,"endLocationLat":36.10805389068134,"endLocationLong":-115.16570490025539,"startAddress":"73 South Martin Luther King Boulevard","endAddress":"920 West Bonanza Road","start":{"address":"73 South Martin Luther King Boulevard","zipCode":"89106"},"end":{"address":"920 West Bonanza Road"},"surgeFactor":1.00,"driverPayment":"4.00","requestedCarType":{"title":"STANDARD","carCategory":"REGULAR","plainIconUrl":"https://media.ride-vegas.com/regular.png","configuration":"{"skipRideAuthorization": false}"},"requestedDriverTypes":[],"freeCreditCharged":"0.00"}
This is the JSON and it is validated correctly over https://jsonlint.com/ . I need to execute the END RIDE API only once when the status is COMPLETED .Is there any way wherein i can do so?

f87krz0w

f87krz0w1#

1.将返回此JSON的请求放在While控制器下
1.添加JSON Extractor作为请求的子项,并按如下所示进行配置:

1.使用以下__jexl3()函数作为While控制器的条件:

${__jexl3("${status}" != "COMPLETED",)}

1.就是这样,While Controller将运行它的子变量(ren),直到status变量不会变为COMPLETED

相关问题