Class WebElementsCondition

java.lang.Object
com.codeborne.selenide.WebElementsCondition
Direct Known Subclasses:
Attributes, ContainExactTextsCaseSensitive, ExactTexts, ItemWithText, ListSize, PredicateCollectionCondition, SizeGreaterThan, SizeGreaterThanOrEqual, SizeLessThan, SizeLessThanOrEqual, SizeNotEqual

@ParametersAreNonnullByDefault 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()
      Overrides:
      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()
    • or

      public WebElementsCondition or(WebElementsCondition alternative)
      Using "or" checks in tests is probably a flag of bad test design. Consider splitting this "or" check into two different methods or tests.
      See Also: