14

Click here to load reader

Java UI Unit Testing with jemmy

Embed Size (px)

Citation preview

Page 1: Java UI Unit Testing with jemmy

Warin LaocharoenKnowledge-Sharing Session - 23 May 2013

Java UI Unit Testing with Jemmy

Wednesday, 22 May, 13

Page 2: Java UI Unit Testing with jemmy

• What's Jemmy

• Jemmy API Usage

• Unit Testing with Jemmy

• Future Integration

• Q&A

Agenda

Wednesday, 22 May, 13

Page 3: Java UI Unit Testing with jemmy

• 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

Page 4: Java UI Unit Testing with jemmy

• not so many tutorials

• not so many presentations and documents

• few samples

What's Jemmy ( cont. )

Wednesday, 22 May, 13

Page 5: Java UI Unit Testing with jemmy

• 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

Page 6: Java UI Unit Testing with jemmy

• 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

Page 7: Java UI Unit Testing with jemmy

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

Page 8: Java UI Unit Testing with jemmy

Jemmy API

• Operatorsused for capture components & actions

• QueueTool / Timeoutstiming tool

• Utility

Wednesday, 22 May, 13

Page 9: Java UI Unit Testing with jemmy

Unit Testing with Jemmy

• integrated with Mock Framework (EasyMock)

• support Continuous Integration (Jenkins)

Wednesday, 22 May, 13

Page 10: Java UI Unit Testing with jemmy

DEMO

Wednesday, 22 May, 13

Page 11: Java UI Unit Testing with jemmy

• integrated with BDD( Behavior-Driven Development )

• Borden Automated Regression Test supported

Future Integration

Wednesday, 22 May, 13

Page 12: Java UI Unit Testing with jemmy

Based on Gherkins Step Definitions

• Given• When• Then• And

defined syntax with:

Wednesday, 22 May, 13

Page 14: Java UI Unit Testing with jemmy

Q & A

Wednesday, 22 May, 13