JMeter Variables And Functions

By Vijay

By Vijay

I'm Vijay, and I've been working on this blog for the past 20+ years! I’ve been in the IT industry for more than 20 years now. I completed my graduation in B.E. Computer Science from a reputed Pune university and then started my career in…

Learn about our editorial policies.
Updated March 7, 2024

Hi Testers!!

In this tutorial, you will learn how you can use variables and functions in Jmeter and make your scripts re-usable.

Below are the topics which are covered in this tutorial:

  • Using Variables in JMeter
  • Using JMeter inbuilt functions like threadnum, counter, machineIP etc.

=> Click here for The Complete Free Training On JMeter (20+ Videos)

JMeter Variables And Functions (1)

Here is a Video Tutorial:

<< PREV   |     NEXT >>

Like any other programming language, you can use variables to store any value and then later make a reference to it anywhere in your program. So, in JMeter, it could be your server name, path, port number or anything which you want to store in a variable and then later use it on many places.

There are many inbuilt functions in JMeter which solves purposes of testing different scenarios.

For example, if you are hitting application on your machine IP rather than any external URL, directly use machine IP function and it would return your IP Address. Function Dialogue is present in the options menu in JMeter and you can see definition and function string from there.

Below is the syntax used for making a call to variable and function in your script.

  • Variable – {varName}. Example – {emailID}
  • Function – {_functionName}. Example – {_counter()}, {_threadNum} etc.

=> Click here for The Complete Free Training On JMeter (20+ Videos)

Was this helpful?

Thanks for your feedback!

Leave a Comment