在 jmeter 的 ForEach 控制器中传递两个变量 [英] Passing two variables in a ForEach controller in jmeter
问题描述
我正在运行一个 ForEach 控制器,我希望控制器在它下面运行服务以更改纬度和经度集.示例-
输入变量前缀:latitude
输出变量名称:Latitude
我想运行控制器以更改纬度"和经度".我试过这样做-
输入变量前缀:纬度,经度
但它不起作用.有没有其他方法可以在 ForEach 控制器中传递两个变量?
很遗憾,您无法使用 ForEach Controller 来解决此问题,但您可以使用
请参阅 这里是什么Do to Combine Multiple JMeter Variables 详细解释上面的表达式是从哪里来的.
I am running a ForEach controller in which I want the controller to run the service underneath it for changes in sets of latitudes and longitudes. example-
Input variable prefix: latitude
Output variable name: Latitude
I want to run the controller for changes in both "latitude" and "longitude". I tried doing this-
Input variable prefix:latitude, longitude
but it does not work. Is there any other way to pass two variables in ForEach controller?
Unfortunately you cannot do it using ForEach Controller, but you can work it around using __V() and __counter() function combination.
For example you have 4 JMeter Variables:
latitude_1=40.7128° N
longitude_1=74.0059° W
latitude_2=32.0853° N
longitude_2=34.7818° E
And you want to iterate them both using ForEach Controller. In that case the relevant configuration would be:
- Input variable prefix:
latitude
- Output variable name: anything meaningful, i.e.
current_latitude
You can refer matching longitude value using the following expression:
${__V(longitude_${__counter(,)})}
Demo:
See Here’s What to Do to Combine Multiple JMeter Variables for detailed explanation of where did the above expression come from.
这篇关于在 jmeter 的 ForEach 控制器中传递两个变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!