Class AttributeWithValue

  • Direct Known Subclasses:
    Href

    @ParametersAreNonnullByDefault
    public class AttributeWithValue
    extends Condition
    • Field Detail

      • expectedAttributeValue

        protected final java.lang.String expectedAttributeValue
    • Constructor Detail

      • AttributeWithValue

        public AttributeWithValue​(java.lang.String attributeName,
                                  java.lang.String expectedAttributeValue)
    • Method Detail

      • apply

        @CheckReturnValue
        public boolean apply​(Driver driver,
                             org.openqa.selenium.WebElement element)
        Description copied from class: Condition
        Check if given element matches this condition.
        Specified by:
        apply in class Condition
        element - given WebElement
        Returns:
        true if element matches condition
      • actualValue

        @Nonnull
        @CheckReturnValue
        public java.lang.String actualValue​(Driver driver,
                                            org.openqa.selenium.WebElement element)
        Description copied from class: Condition
        If element didn't match the condition, returns the actual value of element. Used in error reporting. Optional. Makes sense only if you need to add some additional important info to error message.
        Overrides:
        actualValue in class Condition
        Parameters:
        driver - given driver
        element - given WebElement
        Returns:
        any string that needs to be appended to error message.
      • toString

        @Nonnull
        @CheckReturnValue
        public java.lang.String toString()
        Overrides:
        toString in class Condition
      • getAttributeValue

        protected java.lang.String getAttributeValue​(org.openqa.selenium.WebElement element)