Jmeter跨线程组参数传递
引言:Jmeter中再同一个线程组中,参数传递可以使用 ${变量名} 的方式去传递参数。但是有时我们需要在不同的线程组下传递参数,就需要采用不同的方式了。
1.用正则提取器获取到想要获取到的值:名称为token

2.在线程组A的sampler下使用后置处理器的BeanShellPostProcessor

2.1: Parameters 中填入正则提取器中变量:${token}
2.2: 获取到token的值 ,然后可以理解为键值对的方式存储。然后在后面通过key去调用value值
3.线程组B中使用前置处理器BeanShell PreProcessor并获取线程组A中传递过来的值

4.在调用的时候需要用 ${__P(name)}去使用存储在name中的token
网友评论