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:
latitude
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With