接口测试 jmeter 3.0 多线程组中分别设置的自定义变量,变量不可以重名吗?

sunchuanxin · July 17, 2017 · Last by sunchuanxin replied at July 18, 2017 · 1739 hits

jmeter 3.0 多线程组中分别设置的自定义变量,变量不可以重名吗?

共收到 2 条回复 时间 点赞

If you have more than one Thread Group, make sure you use different names for different values, as UDVs are shared between Thread Groups. Also, the variables are not available for use until after the element has been processed, so you cannot reference variables that are defined in the same element. You can reference variables defined in earlier UDVs or on the Test Plan.

以上为官方文档内容,可见用户定义变量重名后会覆盖的,可以用其他方式生成,比如在 JSR223 PreProcessor 之类的组件里 (是否全部类似组件都支持没考证过) 里提交变量。

Class JMeterVariables
Class which defines JMeter variables. These are similar to properties, but they are local to a single thread.

脚本里提交的属于所在线程,所以多线程之间重名也不会互相影响。

ok 明白了

需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up