public static void assertVisible(LiferaySelenium liferaySelenium, String locator) throws Exception { liferaySelenium.assertElementPresent(locator); if (liferaySelenium.isNotVisible(locator)) { throw new Exception("Element is not visible at \"" + locator + "\""); } }
public static void waitForNotVisible(LiferaySelenium liferaySelenium, String locator) throws Exception { for (int second = 0; ; second++) { if (second >= PropsValues.TIMEOUT_EXPLICIT_WAIT) { liferaySelenium.assertNotVisible(locator); } try { if (liferaySelenium.isNotVisible(locator)) { break; } } catch (Exception e) { } Thread.sleep(1000); } }