Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate User Defined Variables, and hide it from the menus #5877

Open
vlsi opened this issue May 4, 2023 · 3 comments
Open

Deprecate User Defined Variables, and hide it from the menus #5877

vlsi opened this issue May 4, 2023 · 3 comments

Comments

@vlsi
Copy link
Collaborator

vlsi commented May 4, 2023

Expected behavior

There should be a way to initialize variables at the beginning of the test.
For instance:
a) Initialize variables based on properties
b) Set thread-group specific variables

In JMeter, variable should have thread scope, and it is unexpected for the variables from different threads to interfere.
The name User Defined Variable suggests that the config element configures variables, however, it configures test plan variables which is completely misleading

Actual behavior

Currently, User Defined Variables are replaced globally in the test plan which results in surprising behaviour. For instance, if several User Defined Variables located under different thread groups share a variable name, only one of the values win, and the same value is reused for all the threads.

See also

Steps to reproduce the problem

Test plan to reproduce the issue

udv_sharing.zip

JMeter Version

5.5

Java Version

17

OS Version

No response

@markuswege
Copy link

The behaviour of the User Defined Variables is documented:
https://jmeter.apache.org/usermanual/component_reference.html#User_Defined_Variables

UDV are initialized once at test start.

To make this behaviour more clear and to prevent errors, UDVs should be only allowed on "root" level. More than one UDV block could make sense in case some variables rely on others being set before.

@vlsi
Copy link
Collaborator Author

vlsi commented May 8, 2023

Frankly speaking, that documentation and the behavior were obscure to me until I analyzed the sources.
At the same time, the reasons for that behavior are not clear either.

@markuswege
Copy link

I would suggest not to deprecate the UDV, but to separate these.
Global UDV and thread scoped UDV.
That way, the scopes of both would be clear whilst remaining backward compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants