Skip to main content

Jemmy control interfaces

Interfaces define how to do something with UI controls. Each of them define certain "interface" of a control, hence the name.

If you read through lookup tutorial, you are already familiar with Parent interface which defines the way to access controls within some container.

Another examples of Jemmy interfaces are Mouse, Keyboard and Drag

Examples of the interfaces

JemmyCore declares next interfaces which may or may not be used in a UI library specific Jemmy extention:
Inteface Typed by Applicable to Usage
Mouse Anything Allows to click, press, release mouse
Keyboard Anything Allows to push, press, release key and also to type a char
Drag Anything Allows to push, press, release key and also to type a char
Showable Anything Makes control visible. Typically needed in case a control is in a scrollbar or tabbed pane
Focusable Anything Gives control focus.
Parent Child control type Containers Provides access to a hierarchy within a container
Window Windows, frames, dialog Something move-able and resize-able
Selectable Value type, such as boolean for check box, String for list, etc Check boxes, combo boxes, radio buttons, toggle buttons, lists Allows to select a value
CaretOwner Scroll bars, sliders, text controls, lists Allows to "move caret", i.e. to change numeric position attribute of a control
IntervalSelectable Scroll bars, sliders, text controls, lists An extension of CaretOwner which also allows to select portion of the control content
Text Text controls Allows to celar or type text
CaretText Text controls Both Text and CaretOwner.
SelectionText Text controls Both Text and IntervalSelectable. also provides methods to select a portion of text by regexp.
Naturally, UI library specific Jemmy extensions could define own interfaces.

Using interfaces.

Next set of methods allows to use interfaces on any control: and three shortcuts which apply to any control:
  • mouse() a shrtcut to as(Mouse.class)
  • keyboard() a shrtcut to as(Keyboard.class)
  • drag() a shrtcut to as(Drag.class)
Please Confirm