From cf530409316befe0a7c3adf35c745cbe0cfd0f0b Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Mon, 21 Mar 2022 17:24:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=BC=E5=85=A5jmx=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E5=8C=85=E5=90=AB=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E5=8F=98=E9=87=8F=E8=8E=B7=E5=8F=96=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1011455 --user=赵勇 [BUG]github#11608Jmeter测试计划里的自定义变量导入ms失效 https://www.tapd.cn/55049933/s/1122388 --- .../dto/definition/request/unknown/MsJmeterElement.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 c7c3cadf66..0d57be5d8a 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 @@ -77,7 +77,13 @@ public class MsJmeterElement extends MsTestElement { config.getCsvFilePaths().add(csvPath); } } - + // 取出导入的测试计划中变量 + if (scriptWrapper instanceof TestPlan) { + TestPlan testPlan = (TestPlan) scriptWrapper; + if (testPlan.getArguments() != null) { + elementTree.add(testPlan.getArguments()); + } + } if (config.isOperating()) { elementTree = tree.add(scriptWrapper); } else if (!(scriptWrapper instanceof TestPlan) && !(scriptWrapper instanceof ThreadGroup)) {