为Jmeter中的属性设置线程号或线程组ID

时间:2019-01-15 19:00:07

标签: multithreading properties jmeter

如何在jmeter中为道具设置线程名称或线程组ID?我想按以下方式设置我的方案:如果我有6个线程,我将有6个不同的属性。以及如何在配置中调用它?

1 个答案:

答案 0 :(得分:0)

如果通过以下其中一种方式定义名为foo的JMeter属性,其值为bar

  1. 将下一行添加到user.properties file

    foo=bar
    
  2. 或通过-J command-line argument传递属性:

    jmeter -Jfoo=bar -t test.jmx 
    

您可以在任何需要的地方使用__P() function来访问其值:

${__P(foo)}

演示:

enter image description here

查看Apache JMeter Properties Customization Guide,以了解有关JMeter属性以及设置/覆盖它们的方法的更多信息