Class webdriver.ActionSequence
code »Class for defining sequences of complex user interactions. Each sequence
will not be executed until #perform is called.
Example:
new webdriver.ActionSequence(driver).
keyDown(webdriver.Key.SHIFT).
click(element1).
click(element2).
dragAndDrop(element3, element4).
keyUp(webdriver.Key.SHIFT).
perform();
Constructor
| Parameters |
|---|
|
Instance Methods
code »click ( opt_elementOrButton, opt_button ) ⇒ !webdriver.ActionSequenceClicks a mouse button.
If an element is provided, the mouse will first be moved to the center
of that element. This is equivalent to:
sequence.mouseMove(element).click()
!webdriver.ActionSequencesequence.mouseMove(element).click()| Parameters |
|---|
|
| Returns |
|
code »doubleClick ( opt_elementOrButton, opt_button ) ⇒ !webdriver.ActionSequenceDouble-clicks a mouse button.
If an element is provided, the mouse will first be moved to the center of
that element. This is equivalent to:
sequence.mouseMove(element).doubleClick()
Warning: this method currently only supports the left mouse button. See
http://code.google.com/p/selenium/issues/detail?id=4047
!webdriver.ActionSequencesequence.mouseMove(element).doubleClick()| Parameters |
|---|
|
| Returns |
|
code »dragAndDrop ( element, location ) ⇒ !webdriver.ActionSequenceConvenience function for performing a "drag and drop" manuever. The target
element may be moved to the location of another element, or by an offset (in
pixels).
!webdriver.ActionSequence| Parameters |
|---|
|
| Returns |
|
code »keyDown ( key ) ⇒ !webdriver.ActionSequencePerforms a modifier key press. The modifier key is not released
until #keyUp or #sendKeys is called. The key press will be
targetted at the currently focused element.
!webdriver.ActionSequence#keyUp or #sendKeys is called. The key press will be
targetted at the currently focused element.| Parameters |
|---|
|
| Returns |
|
| Throws |
|
code »keyUp ( key ) ⇒ !webdriver.ActionSequencePerforms a modifier key release. The release is targetted at the currently
focused element.
!webdriver.ActionSequence| Parameters |
|---|
|
| Returns |
|
| Throws |
|
code »mouseDown ( opt_elementOrButton, opt_button ) ⇒ !webdriver.ActionSequencePresses a mouse button. The mouse button will not be released until
#mouseUp is called, regardless of whether that call is made in this
sequence or another. The behavior for out-of-order events (e.g. mouseDown,
click) is undefined.
If an element is provided, the mouse will first be moved to the center
of that element. This is equivalent to:
sequence.mouseMove(element).mouseDown()
Warning: this method currently only supports the left mouse button. See
http://code.google.com/p/selenium/issues/detail?id=4047
!webdriver.ActionSequence#mouseUp is called, regardless of whether that call is made in this
sequence or another. The behavior for out-of-order events (e.g. mouseDown,
click) is undefined.
sequence.mouseMove(element).mouseDown()| Parameters |
|---|
|
| Returns |
|
code »mouseMove ( location, opt_offset ) ⇒ !webdriver.ActionSequenceMoves the mouse. The location to move to may be specified in terms of the
mouse's current location, an offset relative to the top-left corner of an
element, or an element (in which case the middle of the element is used).
!webdriver.ActionSequence| Parameters |
|---|
|
| Returns |
|
code »mouseUp ( opt_elementOrButton, opt_button ) ⇒ !webdriver.ActionSequenceReleases a mouse button. Behavior is undefined for calling this function
without a previous call to #mouseDown.
If an element is provided, the mouse will first be moved to the center
of that element. This is equivalent to:
sequence.mouseMove(element).mouseUp()
Warning: this method currently only supports the left mouse button. See
http://code.google.com/p/selenium/issues/detail?id=4047
!webdriver.ActionSequence#mouseDown.
sequence.mouseMove(element).mouseUp()| Parameters |
|---|
|
| Returns |
|
Executes this action sequence.
| Returns |
|---|
|
code »scheduleKeyboardAction_ ( description, keys ) ⇒ !webdriver.ActionSequenceSchedules a keyboard action.
!webdriver.ActionSequencecode »scheduleMouseAction_ ( description, commandName, opt_elementOrButton, opt_button ) ⇒ !webdriver.ActionSequenceSchedules a mouse action.
!webdriver.ActionSequence| Parameters |
|---|
|
| Returns |
|
Schedules an action to be executed each time #perform is called on
this instance.
#perform is called on
this instance.| Parameters |
|---|
|
code »sendKeys ( var_args ) ⇒ !webdriver.ActionSequenceSimulates typing multiple keys. Each modifier key encountered in the
sequence will not be released until it is encountered again. All key events
will be targetted at the currently focused element.
!webdriver.ActionSequence| Parameters |
|---|
|
| Returns |
|
| Throws |
|
Instance Properties
Static Functions
Checks that a key is a modifier key.
| Parameters |
|---|
|
| Throws |
|