简体   繁体   English

如何在JMeter中跨线程组传递变量?

[英]How to pass variables across thread groups in JMeter?

Been trying to extract a value from the response data of a thread group,store it in a variable use the variable in the subsequent thread group. 试图从线程组的响应数据中提取值,将其存储在变量中,然后使用后续线程组中的变量。 Would be great if someone provides insights on how to proceed. 如果有人提供有关如何进行的见解会很好。

Variables are local to a thread. 变量是线程本地的。 Use properties as they're common to all threads. 使用所有线程共有的属性。

From here : 这里

Properties are not the same as variables. 属性与变量不同。 Variables are local to a thread; 变量是线程本地的; properties are common to all threads, and need to be referenced using the __P or __property function. 属性是所有线程共有的,需要使用__P或__property函数进行引用。

  • Use __setProperty() function to convert JMeter Variable to JMeter Property in one thread group 使用__setProperty()函数将一个线程组中的JMeter变量转换为JMeter属性
  • Use __property() function to access previously set property value in another thread group(s) 使用__property()函数访问另一个线程组中先前设置的属性值

See Knit One Pearl Two: How to Use Variables in Different Thread Groups article for detailed explanation 有关详细说明,请参见编织一珍珠二:如何在不同的线程组中使用变量

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM