提交 b583d01b authored 作者: 黄承天's avatar 黄承天

[fix]

params空指针异常
上级 1e129605
...@@ -92,11 +92,11 @@ public class SeleniumExecutor { ...@@ -92,11 +92,11 @@ public class SeleniumExecutor {
try { try {
start(); start();
startTime = new Date(); startTime = new Date();
//开始测试前的准备 若此处有异常则说明测试用例不符 不进行测试 //开始测试前的准备 若此处有异常则说明测试用例数据不符合规范 不进行测试
projectId = testCase.getProjectId(); projectId = testCase.getProjectId();
testId = testCase.getId(); testId = testCase.getId();
name = testCase.getName(); name = testCase.getName();
this.params.addAll(params); this.params = params;
List<Command> commands = testCase.getCommands(); List<Command> commands = testCase.getCommands();
total = commands.size(); total = commands.size();
//根据浏览器 获取driver //根据浏览器 获取driver
...@@ -346,11 +346,7 @@ public class SeleniumExecutor { ...@@ -346,11 +346,7 @@ public class SeleniumExecutor {
success = true; success = true;
break; break;
default: default:
return new Step() return null;
.setSuccess(false)
.setCostTime(-1L)
.setContent("无")
.setMessage("未识别的操作类型:" + type);
} }
} catch (Exception e) { } catch (Exception e) {
log.error(e.getLocalizedMessage()); log.error(e.getLocalizedMessage());
...@@ -469,7 +465,11 @@ public class SeleniumExecutor { ...@@ -469,7 +465,11 @@ public class SeleniumExecutor {
finished = -1; finished = -1;
total = -1; total = -1;
steps.clear(); steps.clear();
params.clear(); if (nonNull(params)) {
params.clear();
} else {
params = new ArrayList<>();
}
seleniumHelper.getHistoryHandles().clear(); seleniumHelper.getHistoryHandles().clear();
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论