Package org.fluentlenium.core.action
Class KeyboardActions
- java.lang.Object
-
- org.fluentlenium.core.action.KeyboardActions
-
public class KeyboardActions extends java.lang.Object
Execute actions with the keyboard.
-
-
Constructor Summary
Constructors Constructor Description KeyboardActions(org.openqa.selenium.WebDriver driver)
Creates a new object to execute actions with the keyboard, using given selenium driver.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected org.openqa.selenium.interactions.Actions
actions()
Get selenium interactions actions.org.openqa.selenium.interactions.Keyboard
basic()
Deprecated.KeyboardActions
keyDown(org.openqa.selenium.Keys theKey)
Performs a modifier key press.KeyboardActions
keyUp(org.openqa.selenium.Keys theKey)
Performs a modifier key release.KeyboardActions
sendKeys(java.lang.CharSequence... keysToSend)
Sends keys to the active element.
-
-
-
Method Detail
-
actions
protected org.openqa.selenium.interactions.Actions actions()
Get selenium interactions actions.- Returns:
- selenium actions
-
basic
@Deprecated public org.openqa.selenium.interactions.Keyboard basic()
Deprecated.Basic keyboard operations- Returns:
- low level interface to control the keyboard
-
keyDown
public KeyboardActions keyDown(org.openqa.selenium.Keys theKey)
Performs a modifier key press. Does not release the modifier key - subsequent interactions may assume it's kept pressed. Note that the modifier key is never released implicitly - either keyUp(theKey) or sendKeys(Keys.NULL) must be called to release the modifier.- Parameters:
theKey
- EitherKeys.SHIFT
,Keys.ALT
orKeys.CONTROL
. If the provided key is none of those,IllegalArgumentException
is thrown.- Returns:
- this object reference to chain calls
- See Also:
Actions.keyDown(CharSequence)
-
keyUp
public KeyboardActions keyUp(org.openqa.selenium.Keys theKey)
Performs a modifier key release. Releasing a non-depressed modifier key will yield undefined behaviour.- Parameters:
theKey
- EitherKeys.SHIFT
,Keys.ALT
orKeys.CONTROL
.- Returns:
- this object reference to chain calls
- See Also:
Actions.keyUp(CharSequence)
-
sendKeys
public KeyboardActions sendKeys(java.lang.CharSequence... keysToSend)
Sends keys to the active element. This differs from callingWebElement.sendKeys(CharSequence...)
on the active element in two ways:- The modifier keys included in this call are not released.
- There is no attempt to re-focus the element - so sendKeys(Keys.TAB) for switching elements should work.
- Parameters:
keysToSend
- The keys.- Returns:
- A self reference.
- See Also:
Actions.sendKeys(CharSequence...)
-
-