【发布时间】:2021-04-22 12:17:42
【问题描述】:
我有这样的要求,比如我需要遍历从匹配 No -1 的正则表达式捕获的所有值
ThreadGroup
---Req1
---Req2
---RegEx: with Match No. -1 (Debug Sampler shows match count : **18** )
---JSR223 Sampler ( Setting the counter value to 1 --**vars.put("counter1","1");**)
---While Controller ( **${__javaScript(parseInt(vars.get("counter1"))<=(${Task_matchNr}),)}** )
----Http req inside While controller
----JSR223 Sampler(Increasing the counter value by 1 everytime till Task_matchNr --**counter = counter+1; vars.put("counter1",Integer.toString(counter));**
每次它会正确执行到第 11 个值,然后再次从第一个值开始执行而不退出循环
有人可以帮忙吗。
【问题讨论】:
标签: while-loop jmeter counter performance-testing