public static void assertNotPartialText(
      LiferaySelenium liferaySelenium, String locator, String pattern) throws Exception {

    liferaySelenium.assertElementPresent(locator);

    if (liferaySelenium.isPartialText(locator, pattern)) {
      String text = liferaySelenium.getText(locator);

      throw new Exception("\"" + text + "\" contains \"" + pattern + "\" at \"" + locator + "\"");
    }
  }
  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 + "\"");
    }
  }