Beruflich Dokumente
Kultur Dokumente
Java Applications
Jiří Skřivánek
Sun Microsystems
360
2
Introduction
> Sun Microsystems
> NetBeans
> NetBeans Quality Engineering
3
AGENDA
UI Functional Testing
> Advantages
– like real user input
– reusability
> Obstacles
– stability of tests
– changing UI
> Existing tools
– commercial (Functional Tester, SilkTest, WinRunner)
– open-source (Abbot, Jemmy, JFCUnit, Marathon)
7
Jemmy Overview
> Java library used to create UI automated tests
> Provides support covering all Swing components
> Can be easily extended for custom component support
> Two modes of action reproducing (Robot and event dispatching)
> Pre/post verification methods
> When test fails? – Jemmy exceptions and timeouts
8
Component ComponentOperator
Container ContainerOperator
JComponent JComponentOperator
JLabel JLabelOperator
9
Jemmy Operators
> Find a window – JFrameOperator, JDialogOperator
> Find a component inside container
– by text
– by ordinal index
– by component name
– using ComponentChooser
> Interact with component
– simulate user actions
– call component API
10
Events
Dispatching mode
Robot
11
Jellytools Overview
> UI test library for NetBeans
> Based on Jemmy
> Uses NetBeans API
> Operators for NetBeans UI components
> High-level functionality
13
TEST
Jellytools Jemmy
API UI
NetBeans
14
Jellytools Operators
> Extend Jemmy operator
> Provide access to all sub components
> Encapsulate localization
> Actions
– menu, popup, shortcut, API
> Nodes
– handle tree-like structures
15
NewFileWizardOperator wizardOper =
NewFileWizardOperator.invoke();
wizardOper.selectProject("MyProject");
//JComboBoxOperator projectOper =
// wizardOper.cboProject();
//projectOper.selectItem("MyProject");
wizardOper.next();
16
XTest Overview
> Open-source test harness
> Runs tests based on JUnit
> Based on Ant
> XTest is able to
– compile tests
– run tests in plain JVM or in NetBeans IDE
– publish test results as HTML pages
17
Publishing Engine
> HTML presentation of test results
– grouped by suites, test bags, projects
– detailed results of test case - status, time, exception stack trace, link to
workdir
> Publishing engine server
– gather results from several sources
– generate summary and history reports
– publish using HTTP server
19
Jemmy/Jellytools Support
> Code completion
> Javadoc included
> JellyTestCase template
> Operator generator
> Jemmy UI browser
22
XTest Module
> XTest harness distribution
> XTest infrastructure wizard
– build scripts
– configuration files
> Project actions
23
Demo
24
Motto