diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsIfController.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsIfController.java index 61a22081cf..c9e995547c 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsIfController.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsIfController.java @@ -42,10 +42,10 @@ public class MsIfController extends MsTestElement { private IfController ifController() { IfController ifController = new IfController(); ifController.setEnabled(true); - ifController.setName(this.getLabelName()); - ifController.setCondition(this.getCondition()); + ifController.setName(StringUtils.isEmpty(this.getName()) ? "IfController" : this.getName()); ifController.setProperty(TestElement.TEST_CLASS, IfController.class.getName()); ifController.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("IfControllerPanel")); + ifController.setCondition(this.getCondition()); ifController.setEvaluateAll(false); ifController.setUseExpression(true); return ifController; diff --git a/backend/src/main/java/io/metersphere/api/jmeter/TestResult.java b/backend/src/main/java/io/metersphere/api/jmeter/TestResult.java index c8914871e7..77cdebca8b 100644 --- a/backend/src/main/java/io/metersphere/api/jmeter/TestResult.java +++ b/backend/src/main/java/io/metersphere/api/jmeter/TestResult.java @@ -60,6 +60,18 @@ public class TestResult { item.getSubRequestResults().forEach(subItem -> { subItem.setName(item.getName()); }); + } else { + if (requestResultMap.containsKey(result.getName())) { + requestResultMap.get(result.getName()).add(item); + } else { + List requestResults = new LinkedList<>(); + requestResults.add(item); + requestResultMap.put(result.getName(), requestResults); + } + item.getSubRequestResults().forEach(subItem -> { + subItem.setName(item.getName()); + }); + } }); }