From fd9fd6c36923a7fb735da562d7d8c0de9242d2cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E5=AE=87=E7=90=A6?= <465645774@qq.com> Date: Sat, 5 Dec 2020 10:37:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BF=94=E5=9B=9E=E5=85=83?= =?UTF-8?q?=E7=B4=A0=E6=90=9C=E7=B4=A2=E6=96=B9=E5=BC=8F=E7=B1=BB=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pres/auxiliary/work/selenium/element/Element.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/pres/auxiliary/work/selenium/element/Element.java b/src/main/java/pres/auxiliary/work/selenium/element/Element.java index 099d37c..acf55e5 100644 --- a/src/main/java/pres/auxiliary/work/selenium/element/Element.java +++ b/src/main/java/pres/auxiliary/work/selenium/element/Element.java @@ -41,8 +41,6 @@ public class Element { this.abstractBy = abstractBy; } - - /** * 用于返回当前存储的{@link WebElement}对象,若该对象为空,则抛出元素查找超时异常 * @return {@link WebElement}对象 @@ -70,7 +68,6 @@ public class Element { } catch (IndexOutOfBoundsException e) { throw new NoSuchElementException("重新获取元素后不存在下标为“" + index + "”的元素,当前元素集合个数:" + abstractBy.elementList.size()); } - } /** @@ -81,6 +78,14 @@ public class Element { return elementData; } + /** + * 返回当前元素的搜索方式类对象 + * @return 元素的搜索方式类对象 + */ + public AbstractBy getBy() { + return abstractBy; + } + /** * 重新根据元素信息,在页面查找元素 */