diff --git a/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioExecuteService.java b/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioExecuteService.java index 31ae197225..5166af453d 100644 --- a/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioExecuteService.java +++ b/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioExecuteService.java @@ -316,6 +316,8 @@ public class ApiScenarioExecuteService { } HashTree hashTree = null; try { + uploadBodyFiles(request.getBodyFileRequestIds(), bodyFiles); + FileUtils.createBodyFiles(request.getScenarioFileIds(), scenarioFiles); this.testElement(request); hashTree = request.getTestElement().generateHashTree(config); LogUtil.info(request.getTestElement().getJmx(hashTree)); @@ -350,8 +352,6 @@ public class ApiScenarioExecuteService { } apiScenarioReportMapper.insert(report); } - uploadBodyFiles(request.getBodyFileRequestIds(), bodyFiles); - FileUtils.createBodyFiles(request.getScenarioFileIds(), scenarioFiles); String runMode = StringUtils.isEmpty(request.getRunMode()) ? ApiRunMode.SCENARIO.name() : request.getRunMode(); // 调用执行方法 JmeterRunRequestDTO runRequest = new JmeterRunRequestDTO(request.getId(), request.getId(), runMode, hashTree); diff --git a/frontend/src/business/components/api/automation/scenario/DebugRun.vue b/frontend/src/business/components/api/automation/scenario/DebugRun.vue index a87b2f5e61..16c6920187 100644 --- a/frontend/src/business/components/api/automation/scenario/DebugRun.vue +++ b/frontend/src/business/components/api/automation/scenario/DebugRun.vue @@ -75,6 +75,9 @@ export default { scenarioId: this.runData.id, testElement: testPlan, projectId: getCurrentProjectID(), environmentMap: strMapToObj(map), environmentType: this.environmentType, environmentGroupId: this.environmentGroupId, environmentJson: JSON.stringify(strMapToObj(map)) }; + if (this.runData.variables) { + reqObj.variables = this.runData.variables; + } this.$emit('runRefresh', {}); saveScenario('/api/automation/run/debug', reqObj, this.runData.hashTree, this, (response) => { this.runId = response.data;