diff --git a/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsJmeterParser.java b/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsJmeterParser.java index 4b200fa4cd..95073d5b45 100644 --- a/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsJmeterParser.java +++ b/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsJmeterParser.java @@ -233,24 +233,24 @@ public class MsJmeterParser extends ScenarioImportAbstractParser { elementNode.setConsumerAndService(consumerAndService); List methodArguments = Constants.getMethodArgs(sampler); + List methodArgs = new LinkedList<>(); if (CollectionUtils.isNotEmpty(methodArguments)) { - List methodArgs = new LinkedList<>(); methodArguments.forEach(item -> { KeyValue keyValue = new KeyValue(item.getParamType(), item.getParamValue()); methodArgs.add(keyValue); }); - elementNode.setArgs(methodArgs); } + elementNode.setArgs(methodArgs); List arguments = Constants.getAttachmentArgs(sampler); + List attachmentArgs = new LinkedList<>(); if (CollectionUtils.isNotEmpty(arguments)) { - List methodArgs = new LinkedList<>(); arguments.forEach(item -> { KeyValue keyValue = new KeyValue(item.getParamType(), item.getParamValue()); - methodArgs.add(keyValue); + attachmentArgs.add(keyValue); }); - elementNode.setAttachmentArgs(methodArgs); } + elementNode.setAttachmentArgs(attachmentArgs); } /**