diff --git a/jmeter-java-dsl/src/main/java/us/abstracta/jmeter/javadsl/JmeterDsl.java b/jmeter-java-dsl/src/main/java/us/abstracta/jmeter/javadsl/JmeterDsl.java index 38915bf4..6f5dda3c 100644 --- a/jmeter-java-dsl/src/main/java/us/abstracta/jmeter/javadsl/JmeterDsl.java +++ b/jmeter-java-dsl/src/main/java/us/abstracta/jmeter/javadsl/JmeterDsl.java @@ -984,6 +984,19 @@ public static DslVariables vars() { return new DslVariables(); } + /** + * Same as {@link #vars()} but allowing to set a name on the element. + *

+ * The name is used to easily identify what the variables are being used for in the jmx. + * + * @see #vars() (String) + * @since 0.22 + **/ + + public static DslVariables vars(String name) { + return new DslVariables(name); + } + /** * Builds a JSR223 Sampler which allows sampling any Java API or custom logic. *

diff --git a/jmeter-java-dsl/src/main/java/us/abstracta/jmeter/javadsl/core/configs/DslVariables.java b/jmeter-java-dsl/src/main/java/us/abstracta/jmeter/javadsl/core/configs/DslVariables.java index 22447422..5a1e6d7d 100644 --- a/jmeter-java-dsl/src/main/java/us/abstracta/jmeter/javadsl/core/configs/DslVariables.java +++ b/jmeter-java-dsl/src/main/java/us/abstracta/jmeter/javadsl/core/configs/DslVariables.java @@ -42,6 +42,10 @@ public DslVariables() { super("User Defined Variables", ArgumentsPanel.class); } + public DslVariables(String name) { + super(name, ArgumentsPanel.class); + } + /** * Allows setting a JMeter thread variable. *