From f38545a6502ee154a199227ffa5f916bc6659ea7 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Wed, 21 Dec 2022 11:36:26 +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=A5=E7=9A=84=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89beanshell=E8=84=9A=E6=9C=AC=E6=B2=A1=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1020951 --user=王孝刚 【接口测试】接口场景中导入带BeanShell自定义脚本的jmx文件,beanshell自定义脚本建议和系统中原有的自定义脚本一样 https://www.tapd.cn/55049933/s/1317941 --- .../java/io/metersphere/api/parse/scenario/JMeterParser.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/api/parse/scenario/JMeterParser.java b/api-test/backend/src/main/java/io/metersphere/api/parse/scenario/JMeterParser.java index 9cdf5a96b6..f760680d8a 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/parse/scenario/JMeterParser.java +++ b/api-test/backend/src/main/java/io/metersphere/api/parse/scenario/JMeterParser.java @@ -744,7 +744,7 @@ public class JMeterParser extends ApiImportAbstractParser { elementNode = new MsJSR223Processor(); BeanUtils.copyBean(elementNode, jsr223Sampler); ((MsJSR223Processor) elementNode).setJsrEnable(false); - ((MsJSR223Processor) elementNode).setScript(jsr223Sampler.getPropertyAsString(ElementConstants.SCRIPT)); + ((MsJSR223Processor) elementNode).setScript(jsr223Sampler.getPropertyAsString("BeanShellSampler.query")); ((MsJSR223Processor) elementNode).setScriptLanguage(jsr223Sampler.getPropertyAsString("scriptLanguage")); } // 后置脚本 @@ -752,7 +752,7 @@ public class JMeterParser extends ApiImportAbstractParser { JSR223PostProcessor jsr223Sampler = (JSR223PostProcessor) key; elementNode = new MsJSR223PostProcessor(); BeanUtils.copyBean(elementNode, jsr223Sampler); - ((MsJSR223PostProcessor) elementNode).setScript(jsr223Sampler.getPropertyAsString("BeanShellSampler.query")); + ((MsJSR223PostProcessor) elementNode).setScript(jsr223Sampler.getPropertyAsString(ElementConstants.SCRIPT)); ((MsJSR223PostProcessor) elementNode).setScriptLanguage(jsr223Sampler.getPropertyAsString("scriptLanguage")); } else if (key instanceof BeanShellPostProcessor) { elementNode = getMsTestElement((BeanShellPostProcessor) key);