fix(接口测试): 修复场景导入非标准JMX文件失败问题
--bug=1027337 --user=王孝刚 【接口测试】接口自动化中导入jmeter文件失败 https://www.tapd.cn/55049933/s/1386032
This commit is contained in:
parent
d8549c278e
commit
bbc8641165
|
@ -106,7 +106,7 @@ public class JMeterParser extends ApiImportAbstractParser<ScenarioImport> {
|
|||
|
||||
MsScenario scenario = new MsScenario();
|
||||
scenario.setReferenced("IMPORT");
|
||||
|
||||
if (testPlan.getArray()[0] instanceof TestPlan) {
|
||||
TestPlan plan = (TestPlan) testPlan.getArray()[0];
|
||||
if (plan.getArguments() != null) {
|
||||
List<ScenarioVariable> variables = new LinkedList<>();
|
||||
|
@ -127,6 +127,9 @@ public class JMeterParser extends ApiImportAbstractParser<ScenarioImport> {
|
|||
scenario.setHashTree(new LinkedList<>());
|
||||
}
|
||||
formatHashTree(testPlan.getTree(plan), scenario);
|
||||
} else {
|
||||
formatHashTree(testPlan, scenario);
|
||||
}
|
||||
this.projectId = request.getProjectId();
|
||||
ScenarioImport scenarioImport = new ScenarioImport();
|
||||
scenarioImport.setData(parseObj(scenario, request));
|
||||
|
|
Loading…
Reference in New Issue