Package org.kquiet.browser.action
Class SendKey
java.lang.Object
org.kquiet.browser.action.MultiPhaseAction
org.kquiet.browser.action.SendKey
- All Implemented Interfaces:
Composable
,MultiPhased
SendKey
is a subclass of MultiPhaseAction
which types into an element. StaleElementReferenceException
may happen while Select
tries to
manipulate the element, so multi-phase is used to perform the action again.- Author:
- Kimberly
-
Constructor Summary
ConstructorsConstructorDescriptionSendKey
(org.openqa.selenium.By by, boolean clearBeforeSend, CharSequence... keysToSend) Create an action to input keys to a specified element.SendKey
(org.openqa.selenium.By by, List<org.openqa.selenium.By> frameBySequence, boolean clearBeforeSend, CharSequence... keysToSend) Create an action to input keys to a specified element. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
clickToSendKeys
(org.openqa.selenium.WebElement element, boolean clearBeforeSend, CharSequence... keysToSend) Clicks an element and then types into 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
-
SendKey
Create an action to input keys to a specified element.- Parameters:
by
- the element locating mechanismclearBeforeSend
-true
: clear before sending;false
: send without clearing firstkeysToSend
- character sequence to send to the element
-
SendKey
public SendKey(org.openqa.selenium.By by, List<org.openqa.selenium.By> frameBySequence, boolean clearBeforeSend, CharSequence... keysToSend) Create an action to input keys to 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)clearBeforeSend
-true
: clear before sending;false
: send without clearing firstkeysToSend
- character sequence to send to the element
-
-
Method Details
-
clickToSendKeys
public static void clickToSendKeys(org.openqa.selenium.WebElement element, boolean clearBeforeSend, CharSequence... keysToSend) Clicks an element and then types into it.- Parameters:
element
- the element to send keys toclearBeforeSend
-true
: clear before sending;false
: send without clearing firstkeysToSend
- character sequence to send to the element
-
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
-