From a07d23edaea510447bb5b7b9ef04fa12990e2a88 Mon Sep 17 00:00:00 2001 From: seagull <24163551@qq.com> Date: Tue, 24 Sep 2019 14:25:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0Web=20UI=E4=B8=AD=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E5=85=83=E7=B4=A0=E5=AD=98=E5=9C=A8=E7=9A=84=E5=85=B3?= =?UTF-8?q?=E9=94=AE=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../caserun/exwebdriver/ex/WebCaseExecution.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/luckyclient/caserun/exwebdriver/ex/WebCaseExecution.java b/src/main/java/luckyclient/caserun/exwebdriver/ex/WebCaseExecution.java index 6db84b8..671c855 100644 --- a/src/main/java/luckyclient/caserun/exwebdriver/ex/WebCaseExecution.java +++ b/src/main/java/luckyclient/caserun/exwebdriver/ex/WebCaseExecution.java @@ -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!");