JMeter 检索值的值

JMeter retrieve value of value

我正在使用jmeter 来测试ldap。 作为测试的一部分,我想在每次迭代中搜索随机 uid。我没有找到一个直接的答案。所以我的想法是首先 select 一个随机数 1-200 并将该数字保存为一个名为 uid 的变量,该数字将对应于一个 UDV 名称。

例如

uid = 2 and 2 = A123456 

在我的 udv 列表中。但是,当尝试在我的 ldap 搜索中引用此变量时 filter.I 我正在尝试使用

(uid=${${uid}}) 

在希望得到uid的值。然而,搜索结果只是将其显示为一个字符串。

<searchfilter>(uid=${${uid}})</searchfilter>

是否有其他方法可以达到我的要求?

使用__V函数

 ${__V(${uid})}

The V (variable) function returns the result of evaluating a variable name expression. This can be used to evaluate nested variable references

${__V(A${N})} - works OK. A${N} becomes A1, and the __V function returns the value of A1

也许最简单的方法是 __RandomFromMultipleVars() function

另一种选择是使用 __V() function, it can combine and evaluate JMeter Variables