Actions

Actions in WebDriver Plus always operate on the first element in the WebElementSet. If you want to apply an action to each element in the set, you should iterate over the set:

for elem in browser.find('input', type='checkbox'):
    elem.click()

Actions return the original WebElementSet, which means they can be chained. For example:

elem = browser.find(id='username')
elem.send_keys('denvercoder9').submit()

Supported actions

Currently the following actions are supported.

Note

Many actions are not yet fully supported natively through WebDriver, and have to instead be simulated using javascript. As a result it’s possible that some behavior may vary slightly between different web browsers.

.click()

Clicks an element.

.double_click()

Double-clicks an element.

.context_click()

Performs a context-click (right click) on an element.

.move_to()

Moves the mouse to center over an element.

.click_and_hold()

Holds down on an element.

.release()

Releases a held click.

.submit()

If the element is a form, submit it. Otherwise search for a form enclosing the element, and submit that.

.clear()

Clears any user editable text from the element.

.send_keys(text)

Sends keys to an element.

Table Of Contents

Previous topic

Selectors

Next topic

Traversing

This Page