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);