Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
1 contributor

Users who have contributed to this file

131 lines (100 sloc) 5.54 KB

Robot Component

This manual page is an early draft. The class FxRobot is annotated with @Beta, thus might be subject to change.

Introduction

TBD.

Concepts

TBD.

Reference

IMPLEMENTATION OF KEYBOARD AND MOUSE ROBOT.

Examples Description
press(F1)
press(CONTROL, SHIFT)
press(PRIMARY)
press(PRIMARY, SECONDARY)
KeyCode... or Mouse...
release(F1)
release(CONTROL, SHIFT)
release(PRIMARY)
release(PRIMARY, SECONDARY)
KeyCode... or Mouse...
releaseKeys()
releaseButtons()

IMPLEMENTATION OF TYPE AND WRITE ROBOT.

Examples Description
push(SHIFT, ENTER)
push(keyCodeCombination)
KeyCode..., KeyCodeCombination
type(NUMPAD8, MINUS, NUMPAD2, ENTER)
type(DOWN, UP)
KeyCode...
type(ENTER, 5) KeyCode int
write('a')
write("typewriter")
write("abc áèö\n")
char, String

IMPLEMENTATION OF MOVE ROBOT.

Examples Description
moveTo() PointQuery
moveTo() x and y, Point2D, Bounds
moveTo() Node, Scene, Window
moveTo() String, Matcher, Predicate
moveBy(50, 50)
moveBy(-100, 0)
x and y

IMPLEMENTATION OF CLICK ROBOT.

Examples Description
click()
click(PRIMARY)
MouseButton...
clickOn(pointQuery) PointQuery
clickOn(100, 200)
clickOn(new Point2D(100, 200))
clickOn(new BoundingBox(0, 0, 50, 50))
two doubles, Point2D, Bounds
clickOn(node)
clickOn(scene)
clickOn(window)
Node, Scene, Window
clickOn("#okButton")
clickOn(LabeledMatchers.hasText("Ok"))
clickOn((Button b) -> b.isDefault())
String, Matcher, Predicate
rightClick() MouseButton...
rightClickOn() PointQuery
rightClickOn() x and y, Point2D, Bounds
rightClickOn() Node, Scene, Window
rightClickOn() String, Matcher, Predicate
doubleClick() MouseButton...
doubleClickOn() PointQuery
doubleClickOn() x and y, Point2D, Bounds
doubleClickOn() Node, Scene, Window
doubleClickOn() String, Matcher, Predicate

IMPLEMENTATION OF DRAG ROBOT.

Examples Description
drag()
drag(SECONDARY)
MouseButton...
dragFrom(pointQuery) PointQuery
dragFrom(100, 200)
dragFrom(new Point2D(100, 200))
dragFrom(new BoundingBox(0, 0, 50, 50))
x and y, Point2D, Bounds
dragFrom(node)
dragFrom(scene)
dragFrom(stage)
dragFrom(window)
Node, Scene, Window
dragFrom("#okButton")
dragFrom("#mainPane .label")
dragFrom("Submit")
dragFrom(NodeMatchers.isEnabled())
dragFrom((node) -> !node.isDisabled())
dragFrom((Button b) -> !b.isDisabled())
String, Matcher, Predicate
drop()
dropTo(pointQuery) PointQuery
dropTo(100, 200)
dropTo(new Point2D(100, 200))
dropTo(new BoundingBox(0, 0, 50, 50))
x and y, Point2D, Bounds
dropTo(node)
dropTo(scene)
dropTo(stage)
dropTo(window)
Node, Scene, Window
dropTo("#okButton")
dropTo("#mainPane .label")
dropTo("Submit")
dropTo(NodeMatchers.isEnabled())
dropTo((node) -> !node.isDisabled())
dropTo((Button b) -> !b.isDisabled())
String, Matcher, Predicate
dropBy(50, 50)
dropBy(-100, 0)
x and y

IMPLEMENTATION OF SCROLL ROBOT.

Examples Description
scroll(UP)
scroll(DOWN)
VerticalDirection
scroll(UP, 5)
scroll(DOWN, 5)
VerticalDirection, int

IMPLEMENTATION OF SLEEP ROBOT.

Examples Description
sleep(250) long
sleep(1, SECONDS) long, TimeUnit

METHODS FOR NODE LOOKUP.

verifyThat(node(anything()), hasItem(hasText("Start"))

Examples Description
node("#okButton")
node("#mainPane .label")
node("Submit")
node(Matchers.anything())
node(NodeMatchers.isEnabled())
node((node) -> !node.isDisabled())
node((Button b) -> !b.isDisabled())
returns NodeQuery. String, Predicate, Matcher
node(queryString, parentNode)
node(matcher, parentNode)
node(predicate, parentNode)
returns NodeQuery. String, Predicate, Matcher and Node... parent nodes
rootNode(node)
rootNode(scene)
rootNode(window)
Window, Scene, Node
rootNode(0)
rootNode(".+FX")
rootNode(Pattern.compile(".+FX"))
rootNode((Window w) -> w.isShowing())
Predicate<Window>, int, Pattern, String
queryNode() returns RawNodeQuery with from(), lookup(), lookupAt(), match()

METHODS FOR POINT POSITION, LOCATION, OFFSET.

Examples Description
targetPos() Pos
point() returns PointQuery. x and y, Point2D, Bounds
point() returns PointQuery. Node, Scene, Window
point() returns PointQuery. String, Matcher, Predicate
offset() returns PointQuery. x and y, Point2D, Bounds
offset() returns PointQuery. Node, Scene, Window
offset() returns PointQuery. String, Matcher, Predicate
queryPoint() returns RawPointQuery with relativeTo(PointQuery)

METHODS FOR WINDOW TARGETING, LOOKUP.

Examples Description
targetWindow() Window, Scene, Node
targetWindow() int, Pattern, String,
window() Scene, Node
window() Predicate<Window>, int, Pattern, String,
listWindows() returns List<Window>
listWindowsInQueue() returns List<Window>
You can’t perform that action at this time.