From 6f3dc8376fbfc6a8caa05cda4caf9d18cf6ba3b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E5=AE=87=E7=90=A6?= <465615774@qq.com> Date: Tue, 26 May 2020 10:53:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=84=E4=B8=AA=E7=B1=BB?= =?UTF-8?q?=E4=B9=8B=E9=97=B4=EF=BC=8C=E7=AA=97=E4=BD=93=E7=9B=B8=E4=BA=92?= =?UTF-8?q?=E4=B8=8D=E9=80=9A=E7=94=A8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pres/auxiliary/work/selenium/element/AbstractBy.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/pres/auxiliary/work/selenium/element/AbstractBy.java b/src/main/java/pres/auxiliary/work/selenium/element/AbstractBy.java index 8f87d23..5d0eff5 100644 --- a/src/main/java/pres/auxiliary/work/selenium/element/AbstractBy.java +++ b/src/main/java/pres/auxiliary/work/selenium/element/AbstractBy.java @@ -55,7 +55,7 @@ public abstract class AbstractBy { /** * 存储当前定位的窗体层级 */ - private ArrayList iframeNameList = new ArrayList<>(); + private static ArrayList iframeNameList = new ArrayList<>(); /** * 用于存储元素通用的等待时间,默认5秒 @@ -261,6 +261,11 @@ public abstract class AbstractBy { //若传参为空,则切回到顶层 if (frameNameList.isEmpty()) { switchRootFrame(); + return; + } + + if (!iframeNameList.isEmpty() && frameNameList.get(frameNameList.size() - 1).equals(iframeNameList.get(iframeNameList.size() - 1))) { + return; } //若不为空,则列表进行切换