Class WebElementCondition

java.lang.Object
com.codeborne.selenide.WebElementCondition
Direct Known Subclasses:
And, Animated, Attribute, AttributeWithValue, AttributeWithValue, Checked, CssClass, CssValue, CustomMatch, Disabled, DomAttribute, DomAttributeValue, DomProperty, DomPropertyValue, 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

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

      public WebElementCondition negate()
    • because

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

      public String toString()
      Overrides:
      toString in class Object
    • getName

      public String getName()
    • missingElementSatisfiesCondition

      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: