if (selenium.isVisible("//section")) { break; } } catch (Exception e) { } Thread.sleep(1000); }