在关键部分控制器中使用 Beanshell 断言

Use Beanshell Assertion inside a Critical Section Controller

我正在尝试在关键部分控制器中使用 Beanshell 断言,但它似乎被忽略了。有人知道为什么会出现这种行为吗?我错过了什么吗?

JMeter 断言仅在 Sampler, if there is no sampler which generates a SampleResult in the Assertion's scope 的上下文中执行 - 它不会被执行。

另请注意 since JMeter 3.1 you should be using JSR223 Test Elements and Groovy language for scripting so consider migrating to JSR223 Assertion 下一个可用的机会

assertions apply to all samplers which are in their scope

Assertion, for instance, is hierarchical in the test tree. If its parent is a request, then it is applied to that request. If its parent is a Controller, then it affects all requests that are descendants of that Controller.