How Properties Differ from Variables
Properties and variables allow you to make data dynamic in JMeter. So, their purposes are very similar:
- Variables are tightly bound to their threads, meaning that every thread has its own copy and can manipulate their own version of a variable.
- Properties are shared among all threads, so changing a property during a test should be avoided. If you really need to change it, ensure that the value is not corrupted by simultaneous access. You can do this by synchronizing this access.
In summary, variables and properties differ in that properties are global and variables are local with respect to threads.
Based on this, we can define two rules:
- Properties should be used for environment-related data.
- Variables should be used for user-related data and correlation rules. That's why, for example, extractors in JMeter will create variables.
How Properties Are Created
Properties are created by JMeter, which reads them from:
- jmeter.properties...