public static void assertText(LiferaySelenium liferaySelenium, String locator, String pattern) throws Exception { liferaySelenium.assertElementPresent(locator); if (liferaySelenium.isNotText(locator, pattern)) { String text = liferaySelenium.getText(locator); throw new Exception( "Pattern \"" + pattern + "\" does not match \"" + text + "\" at \"" + locator + "\""); } }
public static void waitForNotText(LiferaySelenium liferaySelenium, String locator, String value) throws Exception { value = RuntimeVariables.replace(value); for (int second = 0; ; second++) { if (second >= PropsValues.TIMEOUT_EXPLICIT_WAIT) { liferaySelenium.assertNotText(locator, value); } try { if (liferaySelenium.isNotText(locator, value)) { break; } } catch (Exception e) { } Thread.sleep(1000); } }