Package org.kquiet.browser.action
Class Select
java.lang.Object
org.kquiet.browser.action.MultiPhaseAction
org.kquiet.browser.action.Select
- All Implemented Interfaces:
Composable
,MultiPhased
Select
is a subclass of MultiPhaseAction
which selects/deselects options on a
SELECT element. StaleElementReferenceException
may happen while
Select
tries to manipulate the element, so multi-phase is used to perform the action
again.- Author:
- Kimberly
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionSelect
(org.openqa.selenium.By by, List<org.openqa.selenium.By> frameBySequence, Select.SelectBy selectBy, Object... options) Create an action to perform selection against a specific element.Select
(org.openqa.selenium.By by, Select.SelectBy selectBy, Object... options) Create an action to perform selection against a specific element. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
clickToSelect
(org.openqa.selenium.WebElement element, Select.SelectBy selectBy, Object... options) Clicks an element and then performs selecting on it.protected 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
-
Select
Create an action to perform selection against a specific element.- Parameters:
by
- the element locating mechanismselectBy
- the way to perform the selectingoptions
- the option to select; all options are deselected when no option is supplied and the SELECT element supports selecting multiple options
-
Select
public Select(org.openqa.selenium.By by, List<org.openqa.selenium.By> frameBySequence, Select.SelectBy selectBy, Object... options) Create an action to perform selection against a specific 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)selectBy
- the way to perform the selectingoptions
- the option to select; all options are deselected when no option is supplied and the SELECT element supports selecting multiple options
-
-
Method Details
-
clickToSelect
public static void clickToSelect(org.openqa.selenium.WebElement element, Select.SelectBy selectBy, Object... options) Clicks an element and then performs selecting on it.- Parameters:
element
- the element to perform the selectingselectBy
- the way to perform the selectingoptions
- the option to select; all options are deselected when no option is supplied and the SELECT element supports selecting multiple options
-
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
-