This document discusses UI test automation techniques using the JavaFX UI library. It presents the Jemmy tool for automating UI tests in JavaFX. Key points covered include:
- The features of UI libraries important for testing like control hierarchy, controls, transformations, and events
- How Jemmy supports testing JavaFX features through extensions like JemmyFX
- Techniques for writing automated tests using Jemmy including looking up controls, verifying properties, and checking images
- How remote testing can be done by running tests on a separate device through JemmyRemote.
2. <Insert Picture Here>
UI test automation techniques by an example of JavaFX UI.
Alexandre (Shura) Iline
Java quality architect
3. The following is intended to outline our general product
direction. It is intended for information purposes, and
may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or
functionality, and should not be relied upon in making
purchasing decisions.
The development, release, and timing of any features
or functionality described for Oracle's products remains
at the sole discretion of Oracle.
16. 16
Find Do VerifyPass Pass
Pass
Fail Fail Fail
Failure analysis
Find next control
To perform operation
Verify that expected
State reached
Perform necessary
actions
UI test workflow
22. 22
• Type
• Property
– text
– value
– ID
– tooltip
• Image
• Coordinated
• Index (last resort)
• Any criteria which could be written in java code
Lookup principles
Test should be able to find control by ...
25. 25
Control interfaces
Control type Properties
Node Mouse, Keyboard
Control Focusable
ToggleButton Selectable
Text SelectionText
ScrollBar, Slider Scroll
ListView Scroll, Parent<? extends Object>
Scene, Group Parent<Node>
35. 35
Properties
Control type Properties
Node ID bounds
Control get$tooltip get$cursor
ToggleButton get$pressed
Text text get$strikethrough get$underline
Slider, ScrollBar vertical minimum maximum value
CheckBox state is.tri.state
TextInputControl selection.anchor position text
get$columns get$editable
41. 41
TD + *TS NR
TM * NR
NC*
EA =
NC
*
TM
– time needed to run the tests manually
TD
– time needed for automated test development
TS
– time needed for automated test support
NR
– number of test runs
NC
– number of tested configurations
Test automation effectiveness
42. 42
What about record&replay?
• Pretty low TD
– Pretty much the same as TM
… but ...
• High TS
– Generates unmaintainable code
– No test code encapsulation
43. 43
Ideal test
• Lives forever
• Written in terms of domain model
• All the UI logic is hidden within a library
46. 46
JemmyRemote
• Benefits
– Low load on tested UI
– Ability to run on low-end devices
• Limitations
– Two-part code
– Lookup is only through properties
– Slow