增加Web UI中判断元素存在的关键字

This commit is contained in:
seagull 2019-09-24 14:25:18 +08:00
parent c5b50891ff
commit a07d23edae
1 changed files with 13 additions and 0 deletions

View File

@ -134,6 +134,19 @@ public class WebCaseExecution extends TestCaseExecution {
// 页面元素层
if (null != property && null != propertyValue && null != operation) {
WebElement we = isElementExist(wd, property, propertyValue);
//判断元素是否存在关键字
if(operation.equals("iselementexist")){
// 判断此元素是否存在
if (null == we) {
LogUtil.APP.warn("获取到的值是【false】");
return "获取到的值是【false】";
}else{
LogUtil.APP.info("获取到的值是【true】");
return "获取到的值是【true】";
}
}
// 判断此元素是否存在
if (null == we) {
LogUtil.APP.warn("定位对象失败isElementExist为null!");