【发布时间】:2020-04-18 15:17:37
【问题描述】:
当我得到成功响应时,我正在寻求有关如何打破 while 控制器循环的帮助。
Steps:-
1. I have a while controller where I kept below logic
${__javaScript((${controller} < 5),)}
2. And inside while controller I have created http request which return response.
This request takes some time to give result.if this request is still
running it will return status code 202.. and if this request is completed it will give 200.(I have another API to check this)
So here I dont know when it will get success.
for that after each request I have kept waiting time.
So when I call first time after while loop.. its giving 202(because its still running)
and I will continue this process till 5 times..
So here there is chance I can get 200 success code at 3rd request.
So what I want here is I would like to break the loop after that..I dont want to run till 5 times.
I am using below code to read the response.
if (status_code == "200"){
AssertionResult.setFailure(false);
}
所以当我从响应中得到 200 时,它应该停止并获得成功 如果我在所有 5 次尝试中都没有从响应中得到 200,它应该会失败。
【问题讨论】:
标签: jmeter