diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java index b70b2f703a..b28ae07451 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java @@ -83,9 +83,7 @@ public class MsScenario extends MsTestElement { } } // εœΊζ™―ε˜ι‡ - if (CollectionUtils.isNotEmpty(this.getVariables())) { - tree.add(arguments(config)); - } + tree.add(arguments(config)); if (CollectionUtils.isNotEmpty(hashTree)) { for (MsTestElement el : hashTree) { @@ -101,9 +99,11 @@ public class MsScenario extends MsTestElement { arguments.setName(name + "Variables"); arguments.setProperty(TestElement.TEST_CLASS, Arguments.class.getName()); arguments.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("ArgumentsPanel")); - variables.stream().filter(KeyValue::isValid).filter(KeyValue::isEnable).forEach(keyValue -> - arguments.addArgument(keyValue.getName(), keyValue.getValue(), "=") - ); + if (CollectionUtils.isNotEmpty(this.getVariables())) { + variables.stream().filter(KeyValue::isValid).filter(KeyValue::isEnable).forEach(keyValue -> + arguments.addArgument(keyValue.getName(), keyValue.getValue(), "=") + ); + } if (config != null && config.getConfig() != null && config.getConfig().getCommonConfig() != null && CollectionUtils.isNotEmpty(config.getConfig().getCommonConfig().getVariables())) { config.getConfig().getCommonConfig().getVariables().stream().filter(KeyValue::isValid).filter(KeyValue::isEnable).forEach(keyValue ->