Operations.ScrollElement

public static class ScrollElement

internal implementation not be instantiated directly - Action of scroll within an element

Constructors

ScrollElement

public ScrollElement(WebDriver driver, Path wrapper)

ScrollElement

public ScrollElement(WebDriver driver, Path wrapper, int stepSizeOverride)

Methods

down

public void down(Integer n)

scroll down number of pixels

Parameters:
  • n – pixels

downUntilElementIsPresent

public 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

downUntilElementIsPresent

public 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 WebElement downUntilPredicate(Path expectedElement, Predicate<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

downUntilPredicate

public WebElement downUntilPredicate(Path expectedElement, int scrollStep, int maxNumberOfScrolls, Predicate<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

left

public void left(Integer n)

scroll left number of pixels

Parameters:
  • n – pixels

leftUntilElementIsDisplayed

public 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

leftUntilElementIsPresent

public 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

leftUntilElementIsPresent

public 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

leftUntilPredicate

public WebElement leftUntilPredicate(Path expectedElement, Predicate<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

leftUntilPredicate

public WebElement leftUntilPredicate(Path expectedElement, int scrollStep, int maxNumberOfScrolls, Predicate<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

rightUntilElementIsPresent

public 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

rightUntilElementIsPresent

public 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

rightUntilElementIsVisible

public 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 WebElement rightUntilPredicate(Path expectedElement, Predicate<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

rightUntilPredicate

public WebElement rightUntilPredicate(Path expectedElement, int scrollStep, int maxNumberOfScrolls, Predicate<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

toLeftCorner

public void toLeftCorner()

Scroll to left-most point

toTopCorner

public void toTopCorner()

Scroll to top-most point

toTopLeftCorner

public 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

toTopLeftCorner

public void toTopLeftCorner()

Scroll to top-left corner

up

public void up(Integer n)

scroll up number of pixels

Parameters:
  • n – pixels

upUntilElementIsPresent

public 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

upUntilElementIsPresent

public 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

upUntilPredicate

public WebElement upUntilPredicate(Path expectedElement, Predicate<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

upUntilPredicate

public WebElement upUntilPredicate(Path expectedElement, int scrollStep, int maxNumberOfScrolls, Predicate<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