Actions

Actions(Keyboard keyboard)

Only used by the TouchActions class.
Actions(Keyboard keyboard, Mouse mouse)

A constructor that should only be used when the keyboard or mouse were extended to provide additional functionality (for example, dragging-and-dropping from the desktop).
Actions(WebDriver driver)

Default constructor – uses the default keyboard, mouse implemented by the driver.

Action build()

Generates a composite action containing all actions so far, ready to be performed (and resets the internal builder state, so subsequent calls to build() will contain fresh sequences).
Actions click()

Clicks at the current mouse location.
Actions click(WebElement onElement)

Clicks in the middle of the given element.
Actions clickAndHold()

Clicks (without releasing) at the current mouse location.
Actions clickAndHold(WebElement onElement)

Clicks (without releasing) in the middle of the given element.
Actions contextClick()

Performs a context-click at the current mouse location.
Actions contextClick(WebElement onElement)

Performs a context-click at middle of the given element.
Actions doubleClick()

Performs a double-click at the current mouse location.
Actions doubleClick(WebElement onElement)

Performs a double-click at middle of the given element.
Actions dragAndDrop(WebElement source, WebElement target)

A convenience method that performs click-and-hold at the location of the source element, moves to the location of the target element, then releases the mouse.
Actions dragAndDropBy(WebElement source, int xOffset, int yOffset)

A convenience method that performs click-and-hold at the location of the source element, moves by a given offset, then releases the mouse.
Actions keyDown(Keys theKey)

Performs a modifier key press.
Actions keyDown(WebElement element, Keys theKey)

Performs a modifier key press after focusing on an element.
Actions keyUp(Keys theKey)

Performs a modifier key release.
Actions keyUp(WebElement element, Keys theKey)

Performs a modifier key release after focusing on an element.
Actions moveByOffset(int xOffset, int yOffset)

Moves the mouse from its current position (or 0,0) by the given offset.
Actions moveToElement(WebElement toElement)

Moves the mouse to the middle of the element.
Actions moveToElement(WebElement toElement, int xOffset, int yOffset)

Moves the mouse to an offset from the top-left corner of the element.
Actions pause(long pause)

Deprecated.

‘Pause’ is considered to be a bad design practice.
void perform()

A convenience method for performing the actions without calling build() first.
Actions release()

Releases the depressed left mouse button at the current mouse location.
Actions release(WebElement onElement)

Releases the depressed left mouse button, in the middle of the given element.
Actions sendKeys(java.lang.CharSequence... keysToSend)

Sends keys to the active element.
Actions sendKeys(WebElement element, java.lang.CharSequence... keysToSend)

Equivalent to calling: Actions.click(element).sendKeys(keysToSend). This method is different from WebElement.sendKeys(CharSequence...) – see sendKeys(CharSequence...) for details how.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s