From 416de5e3c65b672cb045c61b0258f20591256396 Mon Sep 17 00:00:00 2001 From: caofengbin <1050430934@qq.com> Date: Wed, 21 Jun 2023 19:18:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8F=8C=E7=AB=AF=E7=9A=84fi?= =?UTF-8?q?ndElementList=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BB=85=E5=9C=A8?= =?UTF-8?q?=E6=9F=A5=E6=89=BE=E5=88=B0=E5=85=83=E7=B4=A0=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E9=80=80=E5=87=BAwhile=E5=BE=AA=E7=8E=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sonic/driver/android/service/impl/UiaClientImpl.java | 5 +++-- .../cloud/sonic/driver/ios/service/impl/WdaClientImpl.java | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/cloud/sonic/driver/android/service/impl/UiaClientImpl.java b/src/main/java/org/cloud/sonic/driver/android/service/impl/UiaClientImpl.java index 7c6b43a..41d24e8 100644 --- a/src/main/java/org/cloud/sonic/driver/android/service/impl/UiaClientImpl.java +++ b/src/main/java/org/cloud/sonic/driver/android/service/impl/UiaClientImpl.java @@ -303,10 +303,11 @@ public List findElementList(String selector, String value, Integ androidElementList.add(new AndroidElementImpl(id, this)); } else { logger.error("parse element id %s failed.", ele); - continue; } } - break; + if (androidElementList.size() > 0) { + break; + } } else { logger.error("elements not found. retried %d times, retry in %d ms.", wait, intervalInit); errMsg = b.getErr().getMessage(); diff --git a/src/main/java/org/cloud/sonic/driver/ios/service/impl/WdaClientImpl.java b/src/main/java/org/cloud/sonic/driver/ios/service/impl/WdaClientImpl.java index e07a74b..aeb47b0 100644 --- a/src/main/java/org/cloud/sonic/driver/ios/service/impl/WdaClientImpl.java +++ b/src/main/java/org/cloud/sonic/driver/ios/service/impl/WdaClientImpl.java @@ -452,10 +452,11 @@ public List findElementList(String selector, String value, Integer r iosElementList.add(new IOSElementImpl(id, this)); } else { logger.error("parse element id %s failed.", ele); - continue; } } - break; + if (iosElementList.size() > 0) { + break; + } } else { logger.error("elements not found. retried %d times, retry in %d ms.", wait, intervalInit); errMsg = b.getErr().getMessage();