Skip to content

Commit

Permalink
优化双端的findElementList逻辑,仅在查找到元素的时候退出while循环
Browse files Browse the repository at this point in the history
  • Loading branch information
caofengbin committed Jun 21, 2023
1 parent db52ad7 commit 416de5e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,11 @@ public List<AndroidElement> 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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,10 +452,11 @@ public List<IOSElement> 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();
Expand Down

0 comments on commit 416de5e

Please sign in to comment.