• Like
  • Save
UI test automation techniques by an example of JavaFX UI
Upcoming SlideShare
Loading in...5
×
 

UI test automation techniques by an example of JavaFX UI

on

  • 12,104 views

Test automation is an essential part of a software development process. Being used wisely, it ...

Test automation is an essential part of a software development process. Being used wisely, it

• optimizes testing resources,

• increases testing quality,

• leads to earlier bug detection,

• allows to build continuous development processes.

UI Test automation requires tools, experience and human time investment. The session demonstrates a solution used by Java and JavaFX quality team based on experience of testing such products as Swing, NetBeans, JavaFX SDK and JavaFX Authoring tool. The solution is designed to address the key aspects of UI test automation: effectiveness, test base scalability, stability, and maintainability. The core part of the solution is an open source high-level UI test library Jemmy. During the session, Alexandre will be creating JavaFX UI tests from scratch and demonstrating existing test base for real JavaFX products. He will give an overview of JemmyFX API and explain how UI test automation aspects are applied to real test code. The session is intended for Java and JavaFX UI application developers and quality engineers as well as for everyone interested in UI testing techniques and approaches

Statistics

Views

Total Views
12,104
Views on SlideShare
4,106
Embed Views
7,998

Actions

Likes
0
Downloads
35
Comments
0

20 Embeds 7,998

http://yac2011.yandex.ru 3288
http://company.yandex.ru 2231
http://events.yandex.ru 720
http://yac2011.yandex.com 677
http://tech.yandex.ru 559
http://ya-events.narod.ru 415
http://yac.tadatuta.graymantle.yandex.ru 39
https://tech.yandex.ru 27
http://reminderkeepsake.blogspot.de 11
http://yaceng.tadatuta.graymantle.yandex.ru 11
http://events.lynx.yandex.ru 5
http://company.graymantle.yandex.ru 4
http://www.slashdocs.com 2
https://company.yandex.ru 2
http://external.events.test.tools.yandex-team.ru 2
http://events.yandex-team.ru 1
http://test1e.tech.yandex.ru 1
http://www.company.yandex.ru 1
http://webcache.googleusercontent.com 1
http://web-chib.events.pavo.yandex-team.ru 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    UI test automation techniques by an example of JavaFX UI UI test automation techniques by an example of JavaFX UI Presentation Transcript

    • 1
    • <Insert Picture Here> UI test automation techniques by an example of JavaFX UI. Alexandre (Shura) Iline Java quality architect
    • 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.
    • The presented technology tested on JavaFX Authoring Tool 4
    • Agenda • UI libraries features <Insert Picture Here> (from testing perspective) • UI Sample • Jemmy tool • Writing tests • Reduce test cost support • Remote testing 5
    • <Insert Picture Here> UI features
    • UI libraries features Looking from test side • Hierarchy • Controls • Transformations • Images • Animation • Event queue 7
    • Control hierarchy Stage Control Parent Node Scene http://java.sun.com/javafx/1.3/docs/api/ 8
    • Controls Button ToggleButton RadioButton CheckBox Slider ScrollBar TextBox ListView ComboBox Custom controls http://java.sun.com/javafx/1.3/docs/api/ 9
    • Transformations Affine Rotate Scale Shear Translate http://java.sun.com/javafx/1.3/docs/api/ 10
    • Images 11
    • Animation Timeline Interpolator KeyFrame PathTransition RotateTransition ScaleTransition TranslateTransition http://java.sun.com/javafx/1.3/docs/api/ 12
    • Event queue User UI Other threads 13
    • Tested UI A Bézier curve is a parametric curve frequently used in computer graphics and related fields. 14
    • <Insert Picture Here> Jemmy tool
    • UI test workflow Pass Perform necessary actions Find Pass Do Pass Verify Find next control Verify that expected Fail To perform operation Fail State reached Fail Failure analysis 16
    • Jemmy and extensions Jemmy v2 LCDUI NetBeans JemmySG AWT & Swing JDK JemmyAWT JemmyCore JemmyRemote JemmySWT Jemmy v3 JemmyFX JemmyFXRemote JRMC JavaFX Authoring JavaFX Tool 17
    • JemmyCore Text Interfaces API Scroller Input API Properties API Properties Interfaces Selectable Text Mouse AWT Robot Scroller Keyboard Thumb Scroller Selectable Images Lookup Comparator Hierarchy Criteria Images API Lookup API Factory Coords AWTRobot Custom 18
    • JemmyFX Interfaces API Input API Properties API Properties Interfaces Mouse ot Text ob R AWT Robot FX Scroller Keyboard Operators API Selectable AWT Robot Images Lookup Comparator Hierarchy Criteria Images API Custom Coords Th Lookup API um Text Factory Scenes, ID nodes b Sc ro FXRobot AWTRobot lle r 19
    • <Insert Picture Here> Let's test
    • One line test 21
    • Lookup principles Test should be able to find control by ... • Type • Property – text – value – ID – tooltip • Image • Coordinated • Index (last resort) • Any criteria which could be written in java code 22
    • Lookup code 23
    • More lookup code 24
    • 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> 25
    • Control interfaces usage code 26
    • JemmyFX Browser 27
    • UI test • Customize ... – Curve attributes – View attributes • Verify image • Generate code • Verify code • Start animation • Verify animation 28
    • Test 29
    • Waitings Every UI action takes time • Wait for everything – Window appearance – Label change – Image appearance – Property change – File update • Configurable timeouts • Exceptions 30
    • Waiting code 31
    • Event queue User UI Other threads 32
    • Event queue with a test Lookup Actions Verifications Test UI Other threads 33
    • Pull data through queue 34
    • 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 35
    • Properties code 36
    • Images - = Expected Actual Diff 37
    • Images code 38
    • Animation code 39
    • Verifying generated code 40
    • Test automation effectiveness TM * NR * NC EA = TD + TS * NR * 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 41
    • What about record&replay? • Pretty low TD – Pretty much the same as TM … but ... • High TS – Generates unmaintainable code – No test code encapsulation 42
    • Ideal test • Lives forever • Written in terms of domain model • All the UI logic is hidden within a library 43
    • <Insert Picture Here> Remote testing
    • JemmyRemote Desktop Device Properties Interfaces Properties Text Mouse Scroller Keyboard Selectable Socket Images Lookup Comparator Hierarchy properties Criteria Hierarchy By Factory 45
    • JemmyRemote • Benefits – Low load on tested UI – Ability to run on low-end devices • Limitations – Two-part code – Lookup is only through properties – Slow 46
    • JemmyFXRemote Desktop Device AW Properties Interfaces Properties T Mouse Rob Text ot Scroller Keyboard Selectable Socket Images Lookup FXRobot Comparator Hierarchy properties Criteria Scenes, By Factory nodes AWTRobot 47
    • JemmyFXRemote sample 48
    • References http://jemmy.dev.java.net https://jemmy.dev.java.net/AutomationEffectiveness.html https://jemmy.dev.java.net/RecordingVSCoding.html users@dev.java.net alexandre.iline@oracle.com alexander.kouznetsov@oracle.com 49
    • <Insert Picture Here> UI test automation techniques by an example of JavaFX UI. Alexandre (Shura) Iline Java quality architect
    • Backup slides 51
    • Operators API <Control type name>Operator.find(SceneOperator, <lookup data>) 52
    • JemmyFXScript 53