Class HtmlForm

java.lang.Object
com._4point.testing.matchers.aem.HtmlForm

public class HtmlForm extends Object
Object representing an AEM HTML5 Form
  • Method Details

    • getTitle

      public String getTitle()
      Gets the String value of the text inside the Title element.
      Returns:
      form title
    • create

      public static HtmlForm create(byte[] html, URI baseUri) throws IOException
      Static factory for HtmlForm object. Creates an HtmlForm object. Parses the provided html parameter and then returns an HtmlForm obkect that can be queried for information.
      Parameters:
      html - bytes containing a valid HTML document
      baseUri - the baseUri for the document
      Returns:
      the queriable HtmlForm object
      Throws:
      IOException - if there's an error while parsing the HTML bytes
    • getFieldLabels

      public List<String> getFieldLabels()
      Gets all the field Labels as Strings
      Returns:
      List of field labels
    • hasFieldLabel

      public boolean hasFieldLabel(String candidate)
      Checks if a field label String is among the field labels for this form.
      Parameters:
      candidate - string label that will be searched for
      Returns:
      true if the provided candidate is one of the field lanels