Class WebElementsCondition

Direct Known Subclasses:
Attributes, ContainExactTextsCaseSensitive, ExactTexts, ItemWithText, ListSize, PredicateCollectionCondition, SizeGreaterThan, SizeGreaterThanOrEqual, SizeLessThan, SizeLessThanOrEqual, SizeNotEqual

public abstract class WebElementsCondition extends Object
  • Field Details

    • explanation

      protected String explanation
  • Constructor Details

    • WebElementsCondition

      public WebElementsCondition()
  • Method Details

    • check

      @Nonnull @CheckReturnValue public CheckResult check(Driver driver, List<org.openqa.selenium.WebElement> elements)
    • check

      @Nonnull @CheckReturnValue public CheckResult check(CollectionSource collection)
      The most powerful way to implement condition. Can check the collection using JavaScript or any other effective means. Also, can return "actual values" in the returned CheckResult object.
    • fail

      public void fail(CollectionSource collection, CheckResult lastCheckResult, @Nullable Exception cause, long timeoutMs)
      Override this method if you want to customize error class or description
    • errorMessage

      public String errorMessage()
    • expectedValue

      public String expectedValue()
    • toString

      public abstract String toString()
      toString in class Object
    • because

      public WebElementsCondition because(String explanation)
      Use for explaining the reason of condition: WHY you think this collection should match that condition?
    • missingElementsSatisfyCondition

      public boolean missingElementsSatisfyCondition()