fix(selector): the behavior of findOnce() is different from docs point out

This commit is contained in:
hyb1996
2018-03-09 13:36:52 +08:00
parent c0b03d89d5
commit 16b39b550d
6 changed files with 8 additions and 19 deletions

View File

@@ -169,17 +169,6 @@ public class UiSelector extends UiGlobalSelector {
public UiObject findOnce(int index) {
UiObjectCollection uiObjectCollection = find();
while (uiObjectCollection.empty()) {
if (Thread.currentThread().isInterrupted()) {
throw new ScriptInterruptedException();
}
try {
Thread.sleep(50);
} catch (InterruptedException e) {
throw new ScriptInterruptedException();
}
uiObjectCollection = find();
}
if (index >= uiObjectCollection.size()) {
return null;
}