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 9f2f3614e8..d66e580fcf 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 @@ -333,6 +333,7 @@ public class MsJmeterParser extends ApiImportAbstractParser { if (url != null) { samplerProxy.setUrl(this.getUrl(source)); samplerProxy.setPath(null); + samplerProxy.setCustomizeReq(true); } samplerProxy.setId(UUID.randomUUID().toString()); samplerProxy.setType("HTTPSamplerProxy"); diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/unknown/MsJmeterElement.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/unknown/MsJmeterElement.java index eff991fe79..cb076d3817 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/unknown/MsJmeterElement.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/unknown/MsJmeterElement.java @@ -114,6 +114,10 @@ public class MsJmeterElement extends MsTestElement { for (ScenarioVariable item : list) { if (CollectionUtils.isNotEmpty(item.getFiles())) { List names = item.getFiles().stream().map(BodyFile::getName).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(names) && !names.contains(name) && name.contains("_")) { + String pathArr[] = name.split("_"); + name = pathArr[pathArr.length - 1]; + } if (CollectionUtils.isNotEmpty(names) && names.contains(name)) { if (!config.isOperating() && !new File(FileUtils.BODY_FILE_DIR + "/" + item.getFiles().get(0).getId() + "_" + item.getFiles().get(0).getName()).exists()) { MSException.throwException(StringUtils.isEmpty(item.getName()) ? "CSVDataSet" : item.getName() + ":[ CSV文件不存在 ]");