jMeter>使用beanshell调用测试片段

时间:2014-07-01 00:29:03

标签: jmeter beanshell

我可以从beanshell采样器调用jMeter测试片段或任何其他采样器吗?

我在https://jmeter.apache.org/api/上搜索,但我找不到任何可用于执行此操作的方法。

1 个答案:

答案 0 :(得分:0)

您可能无法从Beanshell采样器调用采样器。我不确定你为什么要那样做。因为JMeter逐个调用采样器 - 所以除非你有一些逻辑控制器,否则你不能改变命令。

The full list of BeanShell variables that is set up is as follows:

log - the Logger
Label - the Sampler label
FileName - the file name, if any
Parameters - text from the Parameters field
bsh.args - the parameters, split as described above
SampleResult - pointer to the current SampleResult
ResponseCode = 200
ResponseMessage = "OK"
IsSuccess = true
ctx - JMeterContext
vars - JMeterVariables - e.g. vars.get("VAR1"); vars.put("VAR2","value"); vars.remove("VAR3"); vars.putObject("OBJ1",new Object());
props - JMeterProperties (class java.util.Properties)- e.g. props.get("START.HMS"); props.put("PROP1","1234");