Package org.kquiet.browser.action
Class ScrollToView
java.lang.Object
org.kquiet.browser.action.MultiPhaseAction
org.kquiet.browser.action.ScrollToView
- All Implemented Interfaces:
Composable
,MultiPhased
ScrollToView
is a subclass of MultiPhaseAction
which scrolls an element into
visible area of the browser window. StaleElementReferenceException
may happen while ScrollToView
tries to manipulate the element, so multi-phase is used to
perform the action again.- Author:
- Kimberly
-
Constructor Summary
ConstructorsConstructorDescriptionScrollToView
(org.openqa.selenium.By by, boolean toTop) Create an action to scroll to view a specified element.ScrollToView
(org.openqa.selenium.By by, List<org.openqa.selenium.By> frameBySequence, boolean toTop) Create an action to scroll to view a specified element. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Perform multiple-phased browser action.toString()
Methods inherited from class org.kquiet.browser.action.MultiPhaseAction
getActionState, getComposer, getCostTime, getErrors, hasNextPhase, isDone, isFail, noNextPhase, perform, setActionState, setComposer, switchToTopForFirefox
-
Constructor Details
-
ScrollToView
public ScrollToView(org.openqa.selenium.By by, boolean toTop) Create an action to scroll to view a specified element.- Parameters:
by
- the element locating mechanismtoTop
-true
: scroll to top;false
: scroll to bottom
-
ScrollToView
public ScrollToView(org.openqa.selenium.By by, List<org.openqa.selenium.By> frameBySequence, boolean toTop) Create an action to scroll to view a specified element.- Parameters:
by
- the element locating mechanismframeBySequence
- the sequence of the frame locating mechanism for the element resides in frame(or frame in another frame and so on)toTop
-true
: scroll to top;false
: scroll to bottom
-
-
Method Details
-
performMultiPhase
protected void performMultiPhase()Description copied from class:MultiPhaseAction
Perform multiple-phased browser action.MultiPhaseAction.noNextPhase()
needs to be invoked to signal that there is no more phase to execute.- Specified by:
performMultiPhase
in classMultiPhaseAction
-
toString
- Overrides:
toString
in classMultiPhaseAction
-