public boolean waitForSelectedLabels(String locator, String pattern) { for (int second = 0; ; second++) { if (second >= TestConsts.TIMEOUT) return false; try { if (pattern.equals(selenium.getSelectedLabels(locator))) return true; } catch (Exception e) { } sleep(1000); } }