最后,JMeter仅限一次控制器 [英] JMeter Once Only Controller at the end

查看:57
本文介绍了最后,JMeter仅限一次控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想对每个线程执行某些操作,因此,我假设tearDown线程组将无法工作.

I would like to perform a certain action per thread, so, I assume that tearDown Thread Group will not work.

是否只有在线程的最后一次迭代时才可以运行仅一次控制器"?

Is there any alternative to run Once Only Controller only if it is the last iteration of a thread?

谢谢.

推荐答案

  1. 如果是控制器测试计划.
  2. 使用以下表达式作为If控制器的条件(假设 __groovy()功能):

  1. Add If Controller to your Test Plan.
  2. Use the following Expression as the If Controller's Condition (assumes __groovy() function):

${__groovy(ctx.getThreadGroup().getSamplerController().getProperty('LoopController.loops').toString() as int == (vars.get('__jm__Thread Group__idx') as int) + 1,)}

  • 放入您要执行的采样器最后作为If Controller的孩子

  • Put Sampler(s) you would like to execute at the end as a child(ren) of the If Controller

    这篇关于最后,JMeter仅限一次控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆