Package org.fluentlenium.core.action
Class KeyboardElementActions
- java.lang.Object
-
- org.fluentlenium.core.action.KeyboardElementActions
-
public class KeyboardElementActions extends java.lang.ObjectExecute actions with the keyboard on a defined element.
-
-
Constructor Summary
Constructors Constructor Description KeyboardElementActions(org.openqa.selenium.WebDriver driver, FluentWebElement fluentWebElement)Creates a new object to execute actions with the keyboard, using given selenium driver and element.KeyboardElementActions(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element)Creates a new object to execute actions with the keyboard, using given selenium driver and element.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.openqa.selenium.interactions.Keyboardbasic()Deprecated.KeyboardElementActionskeyDown(org.openqa.selenium.Keys theKey)Performs a modifier key press after focusing on an element.KeyboardElementActionskeyUp(org.openqa.selenium.Keys theKey)Performs a modifier key release after focusing on an element.KeyboardElementActionssendKeys(java.lang.CharSequence... keysToSend)Sends keys to the active element.
-
-
-
Constructor Detail
-
KeyboardElementActions
public KeyboardElementActions(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element)Creates a new object to execute actions with the keyboard, using given selenium driver and element.- Parameters:
driver- selenium driverelement- element on which to execute actions
-
KeyboardElementActions
public KeyboardElementActions(org.openqa.selenium.WebDriver driver, FluentWebElement fluentWebElement)Creates a new object to execute actions with the keyboard, using given selenium driver and element.- Parameters:
driver- selenium driverfluentWebElement- FluentWebElement on which to execute actions
-
-
Method Detail
-
basic
@Deprecated public org.openqa.selenium.interactions.Keyboard basic()
Deprecated.Basic keyboard operations- Returns:
- low level interface to control the keyboard
-
keyDown
public KeyboardElementActions keyDown(org.openqa.selenium.Keys theKey)
Performs a modifier key press after focusing on an element. Equivalent to: Actions.click(element).sendKeys(theKey);- Parameters:
theKey- EitherKeys.SHIFT,Keys.ALTorKeys.CONTROL. If the provided key is none of those,IllegalArgumentExceptionis thrown.- Returns:
- this object reference to chain calls
- See Also:
keyDown(org.openqa.selenium.Keys),Actions.keyDown(WebElement, CharSequence)
-
keyUp
public KeyboardElementActions keyUp(org.openqa.selenium.Keys theKey)
Performs a modifier key release after focusing on an element. Equivalent to: Actions.click(element).sendKeys(theKey);- Parameters:
theKey- EitherKeys.SHIFT,Keys.ALTorKeys.CONTROL.- Returns:
- this object reference to chain calls
- See Also:
Actions.keyUp(WebElement, CharSequence)
-
sendKeys
public KeyboardElementActions 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:
- this object reference to chain calls
- See Also:
Actions.sendKeys(WebElement, CharSequence...)
-
-