com.atlassian.pageobjects.elements
Interface PageElementKeyboardJavascript


public interface PageElementKeyboardJavascript

Encapsulates Javascript keyboard element events of the PageElement.

PageElement.isPresent() of the corresponding page element must return true before any of the methods of this interface are invoked, otherwise NoSuchElementException will be raised.

NOTE: all events invoked via this class are pure Javascript events and don't simulate the real user-browser interaction. The standard real-browser interaction is that for each pressed key a set of 'keydown', 'keypress' and 'keyup' events is triggered.

NOTE: clients are responsible for providing appropriate key codes for spacial keys for each event. See e.g. http://unixpapa.com/js/key.html.

Use this class primarily as workaround when standard methods in PageElement simulating user interaction don't produce desired results.

Since:
2.1

Method Summary
 PageElementJavascript keyDown(int keyCode)
          Dispatches a 'keydown' event to the associated element.
 PageElementJavascript keyPress(int keyCode)
          

Dispatches a 'keypress' event to the associated element.

 PageElementJavascript keyUp(int keyCode)
          

Dispatches a 'keydown' event to the associated element.

 

Method Detail

keyDown

PageElementJavascript keyDown(int keyCode)
Dispatches a 'keydown' event to the associated element.

Parameters:
keyCode - key code
Returns:
the associated Javascript object

keyPress

PageElementJavascript keyPress(int keyCode)

Dispatches a 'keypress' event to the associated element.

Parameters:
keyCode - key code
Returns:
the associated Javascript object

keyUp

PageElementJavascript keyUp(int keyCode)

Dispatches a 'keydown' event to the associated element.

Parameters:
keyCode - key code
Returns:
the associated Javascript object


Copyright © 2014 Atlassian. All rights reserved.