Warin Laocharoen
Knowledge-Sharing Session - 23 May 2013
Java UI Unit Testing with
Jemmy
Wednesday, 22 May, 13
• What's Jemmy
• Jemmy API Usage
• Unit Testing with Jemmy
• Future Integration
• Q&A
Agenda
Wednesday, 22 May, 13
• A Java library that is used to create
automated tests for Java GUI applications.
• It contains methods to reproduce all user
actions which can be performed on
• Jemmy2 for Swing/AWT
• Jemmy3 for JavaFx components
What's Jemmy
Wednesday, 22 May, 13
• not so many tutorials
• not so many presentations and documents
• few samples
What's Jemmy ( cont. )
Wednesday, 22 May, 13
• Test Harness
Meaning it is not a tool for test execution.
Any harness which is able to execute tests
written in Java (such as JUnit, for example)
could be used to execute tests.
• Record-Replaying Tool
Jemmy is not ....
Wednesday, 22 May, 13
• the same JVM as tested-application
• simulate user operations on components by calling
events
• search components recursively by given criteria
• criteria defined as implementation of
ComponentChooser Interface
How Jemmy works ?
Wednesday, 22 May, 13
Jemmy Workflow
• Find controls you need to do action for
• Do something with that control
• Verify Results of the action
Find Do Verify
Failure Analysis
Pass Pass
Pass
Failed Failed Failed
Wednesday, 22 May, 13
Jemmy API
• Operators
used for capture components & actions
• QueueTool / Timeouts
timing tool
• Utility
Wednesday, 22 May, 13
Unit Testing with Jemmy
• integrated with Mock Framework (EasyMock)
• support Continuous Integration (Jenkins)
Wednesday, 22 May, 13
DEMO
Wednesday, 22 May, 13
• integrated with BDD
( Behavior-Driven Development )
• Borden Automated Regression Test supported
Future Integration
Wednesday, 22 May, 13
Based on Gherkins
Step Definitions
• Given
•When
•Then
•And
defined syntax with:
Wednesday, 22 May, 13
References
• http://jemmy.java.net
• http://wiki.netbeans.org/Jemmy
• http://www.slideshare.net/pa810p/jemmy-
introduction
• http://github.com/cucumber/cucumber-jvm
Wednesday, 22 May, 13
Q & A
Wednesday, 22 May, 13

Java UI Unit Testing with jemmy

  • 1.
    Warin Laocharoen Knowledge-Sharing Session- 23 May 2013 Java UI Unit Testing with Jemmy Wednesday, 22 May, 13
  • 2.
    • What's Jemmy •Jemmy API Usage • Unit Testing with Jemmy • Future Integration • Q&A Agenda Wednesday, 22 May, 13
  • 3.
    • A Javalibrary that is used to create automated tests for Java GUI applications. • It contains methods to reproduce all user actions which can be performed on • Jemmy2 for Swing/AWT • Jemmy3 for JavaFx components What's Jemmy Wednesday, 22 May, 13
  • 4.
    • not somany tutorials • not so many presentations and documents • few samples What's Jemmy ( cont. ) Wednesday, 22 May, 13
  • 5.
    • Test Harness Meaningit is not a tool for test execution. Any harness which is able to execute tests written in Java (such as JUnit, for example) could be used to execute tests. • Record-Replaying Tool Jemmy is not .... Wednesday, 22 May, 13
  • 6.
    • the sameJVM as tested-application • simulate user operations on components by calling events • search components recursively by given criteria • criteria defined as implementation of ComponentChooser Interface How Jemmy works ? Wednesday, 22 May, 13
  • 7.
    Jemmy Workflow • Findcontrols you need to do action for • Do something with that control • Verify Results of the action Find Do Verify Failure Analysis Pass Pass Pass Failed Failed Failed Wednesday, 22 May, 13
  • 8.
    Jemmy API • Operators usedfor capture components & actions • QueueTool / Timeouts timing tool • Utility Wednesday, 22 May, 13
  • 9.
    Unit Testing withJemmy • integrated with Mock Framework (EasyMock) • support Continuous Integration (Jenkins) Wednesday, 22 May, 13
  • 10.
  • 11.
    • integrated withBDD ( Behavior-Driven Development ) • Borden Automated Regression Test supported Future Integration Wednesday, 22 May, 13
  • 12.
    Based on Gherkins StepDefinitions • Given •When •Then •And defined syntax with: Wednesday, 22 May, 13
  • 13.
    References • http://jemmy.java.net • http://wiki.netbeans.org/Jemmy •http://www.slideshare.net/pa810p/jemmy- introduction • http://github.com/cucumber/cucumber-jvm Wednesday, 22 May, 13
  • 14.
    Q & A Wednesday,22 May, 13