Class ElementCountByMethod

  • All Implemented Interfaces:
    com.google.common.base.Function<org.openqa.selenium.WebDriver,​List<org.openqa.selenium.WebElement>>, Function<org.openqa.selenium.WebDriver,​List<org.openqa.selenium.WebElement>>, org.openqa.selenium.support.ui.ExpectedCondition<List<org.openqa.selenium.WebElement>>

    public class ElementCountByMethod
    extends Object
    implements org.openqa.selenium.support.ui.ExpectedCondition<List<org.openqa.selenium.WebElement>>
    Custom ExpectedCondition to evaluate if the amount of web elements in a page match the expected count. This class is to be used with FluentWait (i.e. wait.until(new ElementCountByMethod(..)))
    Author:
    Jose Fernandez
    • Constructor Detail

      • ElementCountByMethod

        public ElementCountByMethod​(String method,
                                    String element,
                                    Integer expectedCount)
    • Method Detail

      • apply

        @Nullable
        public List<org.openqa.selenium.WebElement> apply​(@Nullable
                                                          org.openqa.selenium.WebDriver input)
        Specified by:
        apply in interface com.google.common.base.Function<org.openqa.selenium.WebDriver,​List<org.openqa.selenium.WebElement>>
        Specified by:
        apply in interface Function<org.openqa.selenium.WebDriver,​List<org.openqa.selenium.WebElement>>