JMeter的:如何创建豆壳后处理器阵列,并使其在其他的线程组可用? [英] Jmeter: How to create an array in bean shell post processor and make it available in other thread groups?

查看:210
本文介绍了JMeter的:如何创建豆壳后处理器阵列,并使其在其他的线程组可用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道如何创建豆壳后处理器阵列,并使其在其他线程组可用?

Does anyone knows how to create an array in bean shell post processor and make it available in other thread groups?

我一直在寻找了一段时间,我不设法解决这个问题。

I've been searching for a while and i'm not managing to solve this.

感谢

推荐答案

以下一些建议,我是这样做的:

Following some advice, here's how i did it:

HTTP请求有一个普通的防爆pressions提取提取请求的XPTO变量。然后,BeanShell的PostProcessor中保存数据到CSV文件:

The HTTP request has a Regular Expressions Extractor to extract the XPTO variable from the request. Then, a BeanShell PostProcessor saves data to a CSV file:

String xpto_str = vars.get("XPTO");
log.info("Variable is: " + xpto_str);

f = new FileOutputStream("/tmp/xptos.csv", true);
p = new PrintStream(f); 
this.interpreter.setOut(p); 
print(xpto_str + ",");
f.close();

然后,在第二个线程组,我添加了一个CSV数据集配置,其中我从文件中读取变量。这是很容易的,只需阅读指导(的http://jmeter.apache.org/usermanual/component_reference.html#CSV_Data_Set_Config).

感谢

这篇关于JMeter的:如何创建豆壳后处理器阵列,并使其在其他的线程组可用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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