Dmitri Tikhanski is a Contributing Writer to the BlazeMeter blog.

Become a JMeter and Continuous Testing Pro

Start Learning

Test Your Website Performance NOW! |

arrowPlease enter a URL with http(s)
May 24 2016

Here’s What to Do to Combine Multiple JMeter Variables

Periodically when implementing advanced JMeter test scenarios, you may need to build a JMeter Variable from two or more other variables. This short post will look at how to do just that.


These test scenarios might originate from a Counter Test Element or Function, the __threadNum() function, a regular expression resulting in multiple matches or perhaps a different need.


Let’s imagine the following situation:


There are 2 JMeter Variables:


  1. myVar_1 with the value of foo
  2. myVar_2 with the value of bar


There is also a Counter test element with the reference name of counter.


The objective is to have a dynamic combined variable which consists of:


  • ● Prefix: myVar_

  • ● Postfix: ${counter} variable value that is dynamic


The solution is using the __V() function which can be used to evaluate composite variables.


The syntax is:




In the case above, the resulting composite variable reference would be:




See how to this in the image below.


Combining JMeter Variables


One More Hint


If you build a data-driven test and have parameters in a file that you’re reading by using the __StringFromFile() or __FileToString() functions, and the file has JMeter Variables which need to be substituted with the corresponding values in runtime - you need to use the __eval() function so that the variable value could be resolved.


use the __eval() function in JMeter

Looking for More Info on JMeter Functions?


For more information on the above and other useful JMeter Functions check out the following articles:



Want to Get Expert Answer to your Most Biggest JMeter Questions?


View our on-demand webcast with Andrey Pokhilko, founder of and a core JMeter contributor. After a brief opening look at some of the latest developments following the release of JMeter 3.0, Andrey dedicates most of the session to answering JMeter questions, with live demonstrations included where possible.  


If you have any questions regarding using composite JMeter Variables don’t hesitate to use discussion form below.


arrowPlease enter a URL with http(s)

Interested in writing for our Blog?Send us a pitch!