Class WebElementCondition

Direct Known Subclasses:
And, Animated, Attribute, AttributeWithValue, AttributeWithValue, Checked, CssClass, CssValue, CustomMatch, Disabled, Enabled, Exist, ExplainedCondition, Focused, Hidden, IsImageLoaded, MatchAttributeWithValue, NamedCondition, Not, Or, PartialValue, PseudoElementPropertyWithValue, Selected, TagName, TemporalCondition, TemporalFormatCondition, TextCondition, Value, Visible

public abstract class WebElementCondition extends Object
  • Field Details

    • name

      protected final String name
    • missingElementSatisfiesCondition

      protected final boolean missingElementSatisfiesCondition
  • Constructor Details

    • WebElementCondition

      protected WebElementCondition(String name)
    • WebElementCondition

      protected WebElementCondition(String name, boolean missingElementSatisfiesCondition)
  • Method Details

    • check

      @Nonnull @CheckReturnValue public abstract CheckResult check(Driver driver, org.openqa.selenium.WebElement element)
      Check if given element matches this condition
      driver - selenide driver
      element - given WebElement
      CheckResult.Verdict.ACCEPT if element matches condition, or CheckResult.Verdict.REJECT if element doesn't match (and we should keep trying until timeout).
    • negate

      @Nonnull @CheckReturnValue public WebElementCondition negate()
    • because

      @Nonnull @CheckReturnValue public WebElementCondition because(String message)
      Should be used for explaining the reason of condition
    • toString

      @Nonnull @CheckReturnValue public String toString()
      toString in class Object
    • getName

      @Nonnull @CheckReturnValue public String getName()
    • missingElementSatisfiesCondition

      @CheckReturnValue public boolean missingElementSatisfiesCondition()
    • or

      public WebElementCondition or(WebElementCondition 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: