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 085337e0af..62c5328908 100644 --- a/backend/src/main/java/io/metersphere/api/jmeter/TestResult.java +++ b/backend/src/main/java/io/metersphere/api/jmeter/TestResult.java @@ -90,6 +90,10 @@ public class TestResult { if (StringUtils.isNotEmpty(subItem.getName()) && subItem.getName().indexOf(SEPARATOR) != -1) { String array[] = subItem.getName().split(SEPARATOR); subItem.setName(array[0]); + if (StringUtils.isNotEmpty(subItem.getScenario())) { + List id_names = JSON.parseObject(subItem.getScenario(), List.class); + this.setStatus(id_names, subItem.getError() > 0); + } } }); } @@ -104,5 +108,6 @@ public class TestResult { } } this.setScenarioTotal(this.margeScenariMap.size()); + } } diff --git a/backend/src/main/java/io/metersphere/api/parse/HarScenarioAbstractParser.java b/backend/src/main/java/io/metersphere/api/parse/HarScenarioAbstractParser.java index 17bec09638..a34c804f6c 100644 --- a/backend/src/main/java/io/metersphere/api/parse/HarScenarioAbstractParser.java +++ b/backend/src/main/java/io/metersphere/api/parse/HarScenarioAbstractParser.java @@ -65,6 +65,8 @@ public abstract class HarScenarioAbstractParser extends ApiImportAbstractPars HarPostData content = requestBody.postData; if (!StringUtils.equalsIgnoreCase("GET", requestBody.method) && requestBody.postData == null) { return; + }else if(requestBody.postData == null){ + return; } String contentType = content.mimeType; if (StringUtils.isEmpty(contentType)) {