JMeter 检索值的值 [英] JMeter retrieve value of value
问题描述
我正在使用 jmeter 来测试 ldap.作为测试的一部分,我想在每次迭代中搜索随机 uid.我没有找到一个直接的答案.所以我的想法是首先选择一个随机数 1-200 并将该数字保存为名为 uid 的变量,该数字将对应于 UDV 名称.
例如
uid = 2 和 2 = A123456
在我的 udv 列表中.但是,当尝试在我的 ldap 搜索过滤器中引用此变量时.我正在尝试使用
(uid=${${uid}})
希望得到uid的值.然而,搜索结果只是将其显示为字符串.
(uid=${${uid}})
还有其他方法可以实现我的目标吗?
使用 __V 函数
${__V(${uid})}
<块引用>
V(变量)函数返回对变量名表达式求值的结果.这可用于评估嵌套变量引用
${__V(A${N})} - 工作正常.A${N}变成A1,__V函数返回A1的值
I am using jmeter to test ldap. As part of my test, I want to search for a random uid on each iteration. I did not find a straight forward answer to this. So my idea was to first select a random number 1-200 and saving that number as a variable named uid, that number would correspond to a UDV name.
For example
uid = 2 and 2 = A123456
in my udv list. However when trying to reference this variable in my ldap search filter.I am trying to use
(uid=${${uid}})
in hopes to get the value of the value of uid. However the search results just show this as a string.
<searchfilter>(uid=${${uid}})</searchfilter>
Is there another way to achieve what I am looking for?
Use __V function
${__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
这篇关于JMeter 检索值的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!