您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

JMeter - 用户定义的计数器不会为循环递增

JMeter - 用户定义的计数器不会为循环递增

According to JSR223 Sampler documentation:

JMeter processes function and variable references before passing the script field to the interpreter, so the references will only be resolved once. Variable and function references in script files will be passed verbatim to the interpreter, which is likely to cause a Syntax error. In order to use runtime variables, please use the appropriate props methods, e.g.

props.get("START.HMS");
props.put("PROP1","1234");

So amend the last line of your script to look like:

log.info(vars.get('counter'))

Demo:

还请注意,它使用起来容易得多:

其他 2022/1/1 18:16:12 有510人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶