如何从后处理器获取父控制器的名称 [英] How to get the name of the Parent Controller from a Post Processor
问题描述
我的Jmeter项目结构如下所示,并且我有一个Beanshell后处理器作为子节点.如何从BeanShell后处理器获取父控制器的名称(简单控制器01 )?非常感谢您的帮助.
My Jmeter Project Structure is like following, and I have a Beanshell Post Processor as a child node. How can I get the name of the Parent controller(Simple Controller 01) from the BeanShell post processor? Your help is highly appreciated.
Thread Group
|
|_ Simple Controller 01
|__ Sampler 01
| |__ Beanshell Post Processor
|__ Sampler 02
|
|_ Simple Controller 02
|_ Sampler 03
推荐答案
由于JMeter API设计的限制,这是不可能的,因此我建议重新设计测试计划,以便您知道父控制器的名称.
Directly it is not possible due to JMeter API design limitations so I'd suggest to redesigning your test plan so you would know parent controllers name.
请记住,每当您以某种方式死去的小猫死在某处使用了Reflection来绕过Java限制时,请再想一想,很可能您不需要玩这个技巧.
Remember, any time you bypass Java limitation using Reflection somewhere somehow a kitten dies, so think one more time, most probably you won't need to play this trick.
有关在JMeter中使用Beanshell的更多信息:如何使用BeanShell:JMeter最喜欢的内置组件
More information on using Beanshell in JMeter: How to Use BeanShell: JMeter's Favorite Built-in Component
这篇关于如何从后处理器获取父控制器的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!