Class Operations.ScrollElement

  • Enclosing class:
    Operations

    public static class Operations.ScrollElement
    extends Object
    internal implementation not be instantiated directly - Action of scroll within an element
    • Constructor Summary

      Constructors 
      Constructor Description
      ScrollElement​(org.openqa.selenium.WebDriver driver, Path wrapper)  
      ScrollElement​(org.openqa.selenium.WebDriver driver, Path wrapper, int stepSizeOverride)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void down​(Integer n)
      scroll down number of pixels
      org.openqa.selenium.WebElement downUntilElementIsPresent​(Path expectedElement)
      Scroll down until the DOM contains the expected element.
      org.openqa.selenium.WebElement downUntilElementIsPresent​(Path expectedElement, int scrollStep, int maxNumberOfScrolls)
      Scroll down until the DOM contains the expected element.
      org.openqa.selenium.WebElement downUntilPredicate​(Path expectedElement, int scrollStep, int maxNumberOfScrolls, Predicate<org.openqa.selenium.WebElement> predicate)
      Scroll down until the DOM contains the expected element, and the supplied condition for that element is met.
      org.openqa.selenium.WebElement downUntilPredicate​(Path expectedElement, Predicate<org.openqa.selenium.WebElement> predicate)
      Scroll down until the DOM contains the expected element, and the given condition for that element is met.
      void left​(Integer n)
      scroll left number of pixels
      org.openqa.selenium.WebElement leftUntilElementIsDisplayed​(Path expectedElement)
      Scroll left until the DOM contains the expected element, and it's displayed.
      org.openqa.selenium.WebElement leftUntilElementIsPresent​(Path expectedElement)
      Scroll left until the DOM contains the expected element.
      org.openqa.selenium.WebElement leftUntilElementIsPresent​(Path expectedElement, int scrollStep, int maxNumberOfScrolls)
      Scroll left until the DOM contains the expected element.
      org.openqa.selenium.WebElement leftUntilPredicate​(Path expectedElement, int scrollStep, int maxNumberOfScrolls, Predicate<org.openqa.selenium.WebElement> predicate)
      Scroll left until the DOM contains the expected element and the supplied predicate for the element is met.
      org.openqa.selenium.WebElement leftUntilPredicate​(Path expectedElement, Predicate<org.openqa.selenium.WebElement> predicate)
      Scroll left until the DOM contains the expected element, and the given predicate regarding that element is met.
      void right​(Integer n)
      scroll right number of pixels
      org.openqa.selenium.WebElement rightUntilElementIsPresent​(Path expectedElement)
      Scroll right until the virtualized DOM contains the expect element.
      org.openqa.selenium.WebElement rightUntilElementIsPresent​(Path expectedElement, int scrollStep, int maxNumberOfScrolls)
      Scroll right until the virtualized DOM contains the expect element.
      org.openqa.selenium.WebElement rightUntilElementIsVisible​(Path expectedElement)
      Scroll right until the virtualized DOM contains the expect element, and it is visible Using 40 pixels steps, until the end of the table
      org.openqa.selenium.WebElement rightUntilPredicate​(Path expectedElement, int scrollStep, int maxNumberOfScrolls, Predicate<org.openqa.selenium.WebElement> predicate)
      Scroll right until the DOM contains the expected element and the supplied predicate for the element is met.
      org.openqa.selenium.WebElement rightUntilPredicate​(Path expectedElement, Predicate<org.openqa.selenium.WebElement> predicate)
      Scroll right until the DOM contains the expected element, and the given predicate regarding that element is met.
      void toLeftCorner()
      Scroll to left-most point
      void toTopCorner()
      Scroll to top-most point
      void toTopLeftCorner()
      Scroll to top-left corner
      org.openqa.selenium.WebElement toTopLeftCorner​(Path expectedElement)
      Scroll down until the DOM contains the expected element.
      void up​(Integer n)
      scroll up number of pixels
      org.openqa.selenium.WebElement upUntilElementIsPresent​(Path expectedElement)
      Scroll up until the virtualized DOM contains the expect element.
      org.openqa.selenium.WebElement upUntilElementIsPresent​(Path expectedElement, int scrollStep, int maxNumberOfScrolls)
      Scroll up until the virtualized DOM contains the expect element.
      org.openqa.selenium.WebElement upUntilPredicate​(Path expectedElement, int scrollStep, int maxNumberOfScrolls, Predicate<org.openqa.selenium.WebElement> predicate)
      Scroll up until the DOM contains the expected element, and the supplied condition for that element is met.
      org.openqa.selenium.WebElement upUntilPredicate​(Path expectedElement, Predicate<org.openqa.selenium.WebElement> predicate)
      Scroll up until the DOM contains the expected element, and the given condition for that element is met.
    • Constructor Detail

      • ScrollElement

        public ScrollElement​(org.openqa.selenium.WebDriver driver,
                             Path wrapper)
      • ScrollElement

        public ScrollElement​(org.openqa.selenium.WebDriver driver,
                             Path wrapper,
                             int stepSizeOverride)
    • Method Detail

      • toTopLeftCorner

        public org.openqa.selenium.WebElement toTopLeftCorner​(Path expectedElement)
        Scroll down until the DOM contains the expected element. Using 40 pixels steps, until the end of the table
        Parameters:
        expectedElement - - the element we are looking for
        Returns:
        the WebElement or throws an exception of not found
      • downUntilElementIsPresent

        public org.openqa.selenium.WebElement downUntilElementIsPresent​(Path expectedElement)
        Scroll down until the DOM contains the expected element. Using 40 pixels steps, until the end of the table
        Parameters:
        expectedElement - - the element we are looking for
        Returns:
        the WebElement or throws an exception of not found
      • upUntilPredicate

        public org.openqa.selenium.WebElement upUntilPredicate​(Path expectedElement,
                                                               Predicate<org.openqa.selenium.WebElement> predicate)
        Scroll up until the DOM contains the expected element, and the given condition for that element is met. Using 40 pixels steps, until the end of the table
        Parameters:
        expectedElement - - the element we are looking for
        predicate - - a condition regarding the expected element that is required to be met
        Returns:
        the WebElement or throws an exception of not found
      • downUntilPredicate

        public org.openqa.selenium.WebElement downUntilPredicate​(Path expectedElement,
                                                                 Predicate<org.openqa.selenium.WebElement> predicate)
        Scroll down until the DOM contains the expected element, and the given condition for that element is met. Using 40 pixels steps, until the end of the table
        Parameters:
        expectedElement - - the element we are looking for
        predicate - - a condition regarding the expected element that is required to be met
        Returns:
        the WebElement or throws an exception of not found
      • upUntilElementIsPresent

        public org.openqa.selenium.WebElement upUntilElementIsPresent​(Path expectedElement)
        Scroll up until the virtualized DOM contains the expect element. Using 40 pixels steps, until the end of the table
        Parameters:
        expectedElement - - the element we are looking for
        Returns:
        the WebElement or throws an exception of not found
      • rightUntilElementIsPresent

        public org.openqa.selenium.WebElement rightUntilElementIsPresent​(Path expectedElement)
        Scroll right until the virtualized DOM contains the expect element. Using 40 pixels steps, until the end of the table
        Parameters:
        expectedElement - - the element we are looking for
        Returns:
        the WebElement or throws an exception of not found
      • rightUntilElementIsVisible

        public org.openqa.selenium.WebElement rightUntilElementIsVisible​(Path expectedElement)
        Scroll right until the virtualized DOM contains the expect element, and it is visible Using 40 pixels steps, until the end of the table
        Parameters:
        expectedElement - - the element we are looking for
        Returns:
        the WebElement or throws an exception of not found
      • rightUntilPredicate

        public org.openqa.selenium.WebElement rightUntilPredicate​(Path expectedElement,
                                                                  Predicate<org.openqa.selenium.WebElement> predicate)
        Scroll right until the DOM contains the expected element, and the given predicate regarding that element is met. Using 40 pixels steps, until the end of the table
        Parameters:
        expectedElement - - the element we are looking for
        predicate - - a condition regarding the expected element that is required to be met
        Returns:
        the WebElement or throws an exception of not found
      • leftUntilElementIsPresent

        public org.openqa.selenium.WebElement leftUntilElementIsPresent​(Path expectedElement)
        Scroll left until the DOM contains the expected element. Using 40 pixels steps, until the end of the table
        Parameters:
        expectedElement - - the element we are looking for
        Returns:
        the WebElement or throws an exception of not found
      • leftUntilElementIsDisplayed

        public org.openqa.selenium.WebElement leftUntilElementIsDisplayed​(Path expectedElement)
        Scroll left until the DOM contains the expected element, and it's displayed. Using 40 pixels steps, until the end of the table
        Parameters:
        expectedElement - - the element we are looking for
        Returns:
        the WebElement or throws an exception if not found
      • leftUntilPredicate

        public org.openqa.selenium.WebElement leftUntilPredicate​(Path expectedElement,
                                                                 Predicate<org.openqa.selenium.WebElement> predicate)
        Scroll left until the DOM contains the expected element, and the given predicate regarding that element is met. Using 40 pixels steps, until the end of the table
        Parameters:
        expectedElement - - the element we are looking for
        predicate - - a condition regarding the expected element that is required to be met
        Returns:
        the WebElement or throws an exception of not found
      • downUntilElementIsPresent

        public org.openqa.selenium.WebElement downUntilElementIsPresent​(Path expectedElement,
                                                                        int scrollStep,
                                                                        int maxNumberOfScrolls)
        Scroll down until the DOM contains the expected element.
        Parameters:
        expectedElement - - the element we are looking for
        scrollStep - - scroll step in pixels
        maxNumberOfScrolls - maximum number of scroll operations
        Returns:
        the WebElement or throws an exception of not found
      • downUntilPredicate

        public org.openqa.selenium.WebElement downUntilPredicate​(Path expectedElement,
                                                                 int scrollStep,
                                                                 int maxNumberOfScrolls,
                                                                 Predicate<org.openqa.selenium.WebElement> predicate)
        Scroll down until the DOM contains the expected element, and the supplied condition for that element is met.
        Parameters:
        expectedElement - - the element we are looking for
        scrollStep - - scroll step in pixels
        maxNumberOfScrolls - maximum number of scroll operations
        predicate - - a condition regarding the expected element that is required to be met
        Returns:
        the WebElement or throws an exception of not found
      • upUntilPredicate

        public org.openqa.selenium.WebElement upUntilPredicate​(Path expectedElement,
                                                               int scrollStep,
                                                               int maxNumberOfScrolls,
                                                               Predicate<org.openqa.selenium.WebElement> predicate)
        Scroll up until the DOM contains the expected element, and the supplied condition for that element is met.
        Parameters:
        expectedElement - - the element we are looking for
        scrollStep - - scroll step in pixels
        maxNumberOfScrolls - maximum number of scroll operations
        predicate - - a condition regarding the expected element that is required to be met
        Returns:
        the WebElement or throws an exception of not found
      • upUntilElementIsPresent

        public org.openqa.selenium.WebElement upUntilElementIsPresent​(Path expectedElement,
                                                                      int scrollStep,
                                                                      int maxNumberOfScrolls)
        Scroll up until the virtualized DOM contains the expect element.
        Parameters:
        expectedElement - - the element we are looking for
        scrollStep - - scroll step in pixels
        maxNumberOfScrolls - maximum number of scroll operations
        Returns:
        the WebElement or throws an exception of not found
      • rightUntilElementIsPresent

        public org.openqa.selenium.WebElement rightUntilElementIsPresent​(Path expectedElement,
                                                                         int scrollStep,
                                                                         int maxNumberOfScrolls)
        Scroll right until the virtualized DOM contains the expect element.
        Parameters:
        expectedElement - - the element we are looking for
        scrollStep - - scroll step in pixels
        maxNumberOfScrolls - maximum number of scroll operations
        Returns:
        the WebElement or throws an exception of not found
      • rightUntilPredicate

        public org.openqa.selenium.WebElement rightUntilPredicate​(Path expectedElement,
                                                                  int scrollStep,
                                                                  int maxNumberOfScrolls,
                                                                  Predicate<org.openqa.selenium.WebElement> predicate)
        Scroll right until the DOM contains the expected element and the supplied predicate for the element is met.
        Parameters:
        expectedElement - - the element we are looking for
        scrollStep - - scroll step in pixels
        maxNumberOfScrolls - maximum number of scroll operations
        predicate - - a condition regarding the expected element that is required to be met
        Returns:
        the WebElement or throws an exception of not found
      • leftUntilPredicate

        public org.openqa.selenium.WebElement leftUntilPredicate​(Path expectedElement,
                                                                 int scrollStep,
                                                                 int maxNumberOfScrolls,
                                                                 Predicate<org.openqa.selenium.WebElement> predicate)
        Scroll left until the DOM contains the expected element and the supplied predicate for the element is met.
        Parameters:
        expectedElement - - the element we are looking for
        scrollStep - - scroll step in pixels
        maxNumberOfScrolls - maximum number of scroll operations
        predicate - - a condition regarding the expected element that is required to be met
        Returns:
        the WebElement or throws an exception of not found
      • leftUntilElementIsPresent

        public org.openqa.selenium.WebElement leftUntilElementIsPresent​(Path expectedElement,
                                                                        int scrollStep,
                                                                        int maxNumberOfScrolls)
        Scroll left until the DOM contains the expected element.
        Parameters:
        expectedElement - - the element we are looking for
        scrollStep - - scroll step in pixels
        maxNumberOfScrolls - maximum number of scroll operations
        Returns:
        the WebElement or throws an exception of not found
      • toTopLeftCorner

        public void toTopLeftCorner()
        Scroll to top-left corner
      • toTopCorner

        public void toTopCorner()
        Scroll to top-most point
      • toLeftCorner

        public void toLeftCorner()
        Scroll to left-most point
      • left

        public void left​(Integer n)
        scroll left number of pixels
        Parameters:
        n - pixels
      • right

        public void right​(Integer n)
        scroll right number of pixels
        Parameters:
        n - pixels
      • up

        public void up​(Integer n)
        scroll up number of pixels
        Parameters:
        n - pixels
      • down

        public void down​(Integer n)
        scroll down number of pixels
        Parameters:
        n - pixels