Interface HasValidation

All Superinterfaces:
HasCallFunction, HasElementQuery, HasPropertySettersGetters, HasSearchContext, org.openqa.selenium.SearchContext, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.WebElement
All Known Implementing Classes:
BigDecimalFieldElement, CheckboxElement, CheckboxGroupElement, ComboBoxElement, DatePickerElement, DateTimePickerElement, EmailFieldElement, IntegerFieldElement, MultiSelectComboBoxElement, NumberFieldElement, PasswordFieldElement, RadioButtonGroupElement, SelectElement, TextAreaElement, TextFieldElement, TimePickerElement

public interface HasValidation extends HasPropertySettersGetters, HasElementQuery, HasCallFunction
Implement by elements which support a error message, required indicator and invalid state.
  • Method Details

    • isInvalid

      default boolean isInvalid()
      Checks if the current element is marked as invalid.
      Returns:
      true if the "invalid" attribute exists otherwise false
    • isRequired

      default boolean isRequired()
      Checks if the current element has the "required" attribute.
      Returns:
      true if the element has the "required" attribute, false otherwise.
    • getErrorMessage

      default String getErrorMessage()
      Gets the error message for the element.
      Returns:
      the error message or an empty string if there is no message