SlideShare a Scribd company logo
1 of 36
GUI testing methods
                   Jemmy
           Implementation
                  Features
                     Tools




            Jemmy tutorial
Introduction to Jemmy testing framework


                Pawel Prokop

           pawel.prokop@adfinem.net
                http://prokop.uek.krakow.pl



               March 14, 2012




            Pawel Prokop        Jemmy Introduction
GUI testing methods
                                     Jemmy     Recording tests
                             Implementation    Testing frameworks
                                    Features   Summary
                                       Tools




Manualy testing
    error prone
    slow and not efficient
    repeating test costs a lot
    no place for TDD
    boring for developers
    (dinner syndrome)

    flexible
    look & feel fast feedback




                              Pawel Prokop     Jemmy Introduction
GUI testing methods
                                   Jemmy     Recording tests
                           Implementation    Testing frameworks
                                  Features   Summary
                                     Tools




Recording user actions to exercise the application
    efficient
    fast preparation
    fast execution
    cheap
    hard to modify during application development
    common functionalities

    no place for TDD




                             Pawel Prokop    Jemmy Introduction
GUI testing methods
                                Jemmy     Recording tests
                        Implementation    Testing frameworks
                               Features   Summary
                                  Tools




Available tools for test recording
    SWTBot is an open-source Java based functional testing
    tool for testing SWT and Eclipse based applications.
    http://www.eclipse.org/swtbot/
    Marathon allows to record the script that can be modified
    later manualy. Supports assertions.
    www.marathontesting.com/
    Jacareto is a tool that allows capture actions on
    applications and replay them later.
    http://jacareto.sourceforge.net/wiki




                         Pawel Prokop     Jemmy Introduction
GUI testing methods
                                  Jemmy     Recording tests
                          Implementation    Testing frameworks
                                 Features   Summary
                                    Tools




Write code that simulates user actions
    efficient
    moderate slow preparation
    parts of code may be reused
    fast execution
    easy to modify during application development
    can be used with TDD




                           Pawel Prokop     Jemmy Introduction
GUI testing methods
                               Jemmy     Recording tests
                       Implementation    Testing frameworks
                              Features   Summary
                                 Tools




Testing frameworks
    UISpec4J is an open source framework to test Swing
    applications.
    http://www.uispec4j.org/
    JFCUnit is an extension of JUnit that allows to execute unit
    tests against Swing based interface.
    http://jfcunit.sourceforge.net/
    Jemmy is an open source framework that allows to
    simulate user interactions with Swing applications.
    https://svn.java.net/svn/jemmy~svn




                        Pawel Prokop     Jemmy Introduction
GUI testing methods
                                  Jemmy     Recording tests
                          Implementation    Testing frameworks
                                 Features   Summary
                                    Tools



Summary


                       Manual testing             Recording      Framework
  Efficiency                 -                        +                +
  Preparation time          +                        +               +/-
  Execution time            -                        +                +
  Price                     -                        +                +
  Reusability               -                         -               +
  TDD                       -                         -               +
  Flexibility               +                         -               -




                           Pawel Prokop     Jemmy Introduction
GUI testing methods
                                 Jemmy
                                           Introduction
                         Implementation
                                           Installation
                                Features
                                   Tools


Jemmy introduction


  Jemmy documentation
      not so many tutorials
      not so many presentations and documents
      good javadoc is enough to start
      few samples
      low Jemmy vitality




                          Pawel Prokop     Jemmy Introduction
GUI testing methods
                                    Jemmy
                                              Introduction
                            Implementation
                                              Installation
                                   Features
                                      Tools



Jemmy framework

  How Jemmy works?
     the same JVM as tested application
     simulates user operations on the components by calling
     events
     events are stored on the QueueTool class and then provided to AWT
     EventQueue

     search components recursively by given criteria (caption,
     name)
     criteria defined as implementation of ComponentChooser
     interface


                             Pawel Prokop     Jemmy Introduction
GUI testing methods
                                 Jemmy
                                           Introduction
                         Implementation
                                           Installation
                                Features
                                   Tools



Jemmy framework



  Jemmy in TDD approach
     design UI interface and the components
     implement jemmy tests to fit the interface
     run failing tests
     create implementation and re-run tests until they pass




                          Pawel Prokop     Jemmy Introduction
GUI testing methods
                                          Jemmy
                                                    Introduction
                                  Implementation
                                                    Installation
                                         Features
                                            Tools




Jemmy Installation Eclipse
    add jemmy.jar to the Java Build Path




                                    Pawel Prokop    Jemmy Introduction
GUI testing methods
                                           Jemmy
                                                     Introduction
                                   Implementation
                                                     Installation
                                          Features
                                             Tools




Jemmy Installation Netbeans
    add Jar/Folder to Libraries




                                    Pawel Prokop     Jemmy Introduction
GUI testing methods
                                                            Jemmy
                                                                                  Introduction
                                                    Implementation
                                                                                  Installation
                                                           Features
                                                              Tools


Integration with JUnit
 1   @Ignore
 2   p u b l i c c l a s s CommonTest {
 3          protected s t a t i c JMyApplication a p p l i c a t i o n = n u l l ;
 4
 5        p u b l i c CommonTest ( ) { }
 6
 7        @BeforeClass
 8        p u b l i c s t a t i c v o i d setUpClass ( ) throws E x c e p ti o n { }
 9
10        @AfterClass
11        p u b l i c s t a t i c v o i d tearDownClass ( ) throws E x c e p ti o n { }
12
13        @Before
14        p u b l i c v o i d setUp ( ) throws E x c e p ti o n {
15                a p p l i c a t i o n = new J M y A p p l i c a t i o n ( ) ;
16                a p p l i c a t i o n . startJMyForms ( ) ;
17        }
18
19        @After
20        p u b l i c v o i d tearDown ( ) throws E x c e p ti o n {
21                a p p l i c a t i o n . stopJMyForms ( ) ;
22        }
23   }



                                                        Pawel Prokop              Jemmy Introduction
GUI testing methods
                              Jemmy
                                        Introduction
                      Implementation
                                        Installation
                             Features
                                Tools


Integration with Ant




                       Pawel Prokop     Jemmy Introduction
GUI testing methods
                                                              Jemmy
                                                                                     Introduction
                                                      Implementation
                                                                                     Installation
                                                             Features
                                                                Tools


Integration with Ant


 1   < p r o j e c t name= " JemmySample " >
 2          < t a r g e t name= " j u n i t " >
 3                  < j u n i t printsummary= " yes " >
 4                         < c l a s s p a t h path= " l i b s / j u n i t −4.5. j a r " / >
 5                         < c l a s s p a t h path= " l i b s / jemmy . j a r " / >
 6                         < c l a s s p a t h path= " b u i l d / t e s t / c l a s s e s / " / >
 7                         < c l a s s p a t h path= " b u i l d / c l a s s e s / " / >
 8                         < b a t c h t e s t f o r k = " yes " >
 9                                 < f i l e s e t d i r = " t e s t " i n c l u d e s = " ∗∗/∗ Test . j a v a " / >
10                         </ batchtest>
11                  </ junit>
12          </ target>
13   </ project>


 1   a n t −f j u n i t . xml j u n i t




                                                           Pawel Prokop              Jemmy Introduction
GUI testing methods    Operators
                                        Jemmy     Concept depended approach
                                Implementation    Component choosers
                                       Features   Timeouts
                                          Tools   Find components



Operators

     Communication with UI controls is realized by operators
     Jemmy defines own operators for every AWT/Swing UI
     component
         JFrameOperator
         JDialogOperator
         JButtonOperator

         JCheckBoxOperator
         JComboBoxOperator
         JFileChooserOperator
         ...and many others


     Operators can be extended by the developer


                                 Pawel Prokop     Jemmy Introduction
GUI testing methods                Operators
                                                   Jemmy                 Concept depended approach
                                           Implementation                Component choosers
                                                  Features               Timeouts
                                                     Tools               Find components



Operators - small example


        Yes/No dialog operator
    1   p u b l i c c l a s s YesNoDialogOperator extends J D i a l o g O p e r a t o r {
    2           p u b l i c YesNoDialogOperator ( ) {
    3                  super ( " C o n f i r m a t i o n " ) ;
    4           }
    5
    6        p u b l i c v o i d pushYes ( ) {
    7               new J B u t t o n O p e r a t o r ( t h i s , " Yes " ) . push ( ) ;
    8        }
    9
   10        p u b l i c v o i d pushNo ( ) {
   11               new J B u t t o n O p e r a t o r ( t h i s , "No" ) . push ( ) ;
   12        }
   13   }




                                               Pawel Prokop              Jemmy Introduction
GUI testing methods    Operators
                                           Jemmy     Concept depended approach
                                   Implementation    Component choosers
                                          Features   Timeouts
                                             Tools   Find components



Operators - small example


        Usage
    1   // ...
    2   @Test
    3   public void test_some_functionality ( ) {
    4       // ...
    5       YesNoDialogOperator o p e r a t o r = new YesNoDialogOperator ( ) ;
    6       assertNotNull ( operator ) ;
    7       o p e r a t o r . pushYes ( ) ;
    8       // ...
    9   }
   10   // ...




                                    Pawel Prokop     Jemmy Introduction
GUI testing methods        Operators
                                            Jemmy         Concept depended approach
                                    Implementation        Component choosers
                                           Features       Timeouts
                                              Tools       Find components


Load application with jemmy



        class reference
    1      new ClassReference ( " jemmysample . JemmySampleApplication " ) . s t a r t A p p l i c a t i o n ( ) ;



        direct call
    1      JemmySampleApplication . main ( n u l l ) ;




                                      Pawel Prokop        Jemmy Introduction
GUI testing methods                Operators
                                                    Jemmy                 Concept depended approach
                                            Implementation                Component choosers
                                                   Features               Timeouts
                                                      Tools               Find components



Concept depended approach
       create classes that support some application’s
       functionality:
   1   c l a s s MyMainDialog extends J D i a l o g O p e r a t o r {
   2           p u b l i c s t a t i c S t r i n g d i a l o g C a p t i o n = "My D i a l o g " ;
   3
   4         p u b l i c MyMainDialog ( ) { super ( d i a l o g C a p t i o n ) ; }
   5
   6         p u b l i c v o i d pushButtonCancel ( ) {
   7                new J B u t t o n O p e r a t o r ( " Cancel " ) . push ( ) ;
   8         }
   9   }



       and then use them from test suites:
   1   @Test
   2   public void test_dialog_can_cancel ( ) {
   3       MyMainDialog d i a l o g O p e r a t o r = new MyMainDialog ( ) ;
   4       d i a l o g O p e r a t o r . pushButtonCancel ( ) ;
   5   }



                                                Pawel Prokop              Jemmy Introduction
GUI testing methods        Operators
                                                Jemmy         Concept depended approach
                                        Implementation        Component choosers
                                               Features       Timeouts
                                                  Tools       Find components



Application Shadow

 1   public class JMyApplication {
 2       p r i v a t e JFrameOperator mainFrame = n u l l ;
 3
 4       p u b l i c JFrameOperator getMainFrame ( ) {
 5               r e t u r n mainFrame ;
 6       }
 7
 8       p u b l i c i n t startJMyForms ( ) {
 9              JemmySampleApplication . main ( n u l l ) ;
10              mainFrame = new JFrameOperator ( " JMyForms " ) ;
11               return 0;
12       }
13
14       p u b l i c i n t stopJMyForms ( ) {
15              JMenuBarOperator menuBarOp = new JMenuBarOperator ( mainFrame ) ;
16              JMenuOperator f i l e M e n u = new JMenuOperator ( menuBarOp . getMenu ( 0 ) ) ;
17              f i l e M e n u . pushMenu ( " F i l e | E x i t " ) ;
18               return 0;
19       }
20   }




                                          Pawel Prokop        Jemmy Introduction
GUI testing methods    Operators
                                           Jemmy     Concept depended approach
                                   Implementation    Component choosers
                                          Features   Timeouts
                                             Tools   Find components



The Component Choosers

  How to find component?
     using its index inside the container
     textfield next to label

     using Component Chooser implementation
             NameComponentChooser uses a name property
             PropChooser uses properties and methods to match a
             component
             Developer can define custom component choosers -
             implementing ComponentChooser interface




                                    Pawel Prokop     Jemmy Introduction
GUI testing methods              Operators
                                                        Jemmy               Concept depended approach
                                                Implementation              Component choosers
                                                       Features             Timeouts
                                                          Tools             Find components



RegexpFrameTitleChooser
 1   p u b l i c c l a s s RegexpFrameTitleChooser implements ComponentChooser {
 2          Pattern pattern = n u l l ;
 3
 4       p u b l i c RegexpFrameTitleChooser ( S t r i n g p a t t e r n ) {
 5               t h i s . p a t t e r n = P a t t e r n . compile ( p a t t e r n ) ;
 6       }
 7
 8       @Override
 9       p u b l i c boolean checkComponent ( Component component ) {
10               i f ( component i n s t a n c e o f JFrame ) {
11                     S t r i n g f r a m e T i t l e = ( ( JFrame ) component ) . g e t T i t l e ( ) ;
12                     Matcher matcher = p a t t e r n . matcher ( f r a m e T i t l e ) ;
13                     r e t u r n matcher . matches ( ) ;
14               }
15               return false ;
16       }
17
18       @Override
19       public String getDescription ( ) {
20          return pattern . pattern ( ) ;
21       }
22   }




                                                   Pawel Prokop             Jemmy Introduction
GUI testing methods     Operators
                                                Jemmy      Concept depended approach
                                        Implementation     Component choosers
                                               Features    Timeouts
                                                  Tools    Find components



ShowingComponentChooser


 1   p u b l i c c l a s s ShowingNameComponentChooser extends NameComponentChooser {
 2           p u b l i c ShowingNameComponentChooser ( S t r i n g name ) {
 3                  super ( name ) ;
 4           }
 5
 6       @Override
 7       p u b l i c boolean checkComponent ( Component component ) {
 8               i f ( super . checkComponent ( component ) && component . isShowing ( ) ) {
 9                     return true ;
10               }
11               return false ;
12       }
13
14
15
16   }




                                         Pawel Prokop      Jemmy Introduction
GUI testing methods    Operators
                        Jemmy     Concept depended approach
                Implementation    Component choosers
                       Features   Timeouts
                          Tools   Find components


Timeouts


                                                        time values
                                                        (millisec-
                                                        onds) to wait
                                                        for
                                                        something to
                                                        be done by
                                                        the
                                                        application




                 Pawel Prokop     Jemmy Introduction
GUI testing methods              Operators
                                            Jemmy               Concept depended approach
                                    Implementation              Component choosers
                                           Features             Timeouts
                                              Tools             Find components


Timeouts


     to delay simulated user behaviour
           kept by org.netbeans.jemmy.Timeouts class
      1    / / Set d e l a y b e f o r e key i s pressed d u r i n g t y p i n g
      2    JemmyProperties . g e t C u r r e n t T i m e o u t s ( ) . setTimeout
      3         ( " JTextComponentOperator . PushKeyTimeout " , 5 0 ) ;


           each instance can have its own timeouts set
      1    / / Set d e l a y between b u t t o n p r e s s i n g and r e l e a s i n g .
      2    J B u t t o n O p e r a t o r b t n O p e r a t o r = new J B u t t o n O p e r a t o r ( " Process " ) ;
      3    b t n O p e r a t o r . getTimeouts ( )
      4            . setTimeout ( " A b s t r a c t B u t t o n O p e r a t o r . PushButtonTimeout " , 5 0 0 ) ;




                                       Pawel Prokop             Jemmy Introduction
GUI testing methods              Operators
                                                   Jemmy               Concept depended approach
                                           Implementation              Component choosers
                                                  Features             Timeouts
                                                     Tools             Find components


Timeouts cont.



        to wait until timeout exception is raised
    1   / / w a i t up t o 5 seconds f o r J D i a l o g
    2   JemmyProperties . g e t C u r r e n t T i m e o u t s ( ) . setTimeout
    3           ( " D i a l o g W a i t e r . WaitDialogTimeout " , 5 0 0 0 ) ;
    4   J D i a l o g O p e r a t o r albums = new J D i a l o g O p e r a t o r ( " D i a l o g Caption " ) ;




                                               Pawel Prokop            Jemmy Introduction
GUI testing methods    Operators
                                Jemmy     Concept depended approach
                        Implementation    Component choosers
                               Features   Timeouts
                                  Tools   Find components


More timeouts

     JComboBoxOperator.BeforeSelectingTimeout -
     time to sleep after list opened and before item selected
     JComboBoxOperator.WaitListTimeout - time to wait
     list opened
     ComponentOperator.WaitStateTimeout - time to
     wait for item to be selected
     JTextComponentOperator.PushKeyTimeout - time
     between key pressing and releasing during text typing
     JTextComponentOperator.BetweenKeysTimeout -
     time to sleep between two chars typing


                         Pawel Prokop     Jemmy Introduction
GUI testing methods                Operators
                                                     Jemmy                 Concept depended approach
                                             Implementation                Component choosers
                                                    Features               Timeouts
                                                       Tools               Find components



find method vs operator constructor
        static find method returns the operator or null
        immediately:
    1   @Test
    2   public void test_some_functionality ( ) {
    3       // ...
    4       J D i a l o g O p e r a t o r myDialog = J D i a l o g O p e r a t o r . f i n d D i a l o g ( " E r r o r " , t r u e , t r u e ) ;
    5       i f ( n u l l == myDialog )            {
    6               / / no E r r o r d i a l o g i s c u r r e n t l y d i s p l a y e d
    7       }
    8       // ...
    9   }


        constructor blocks until component appears on the screen
        or timeout.
    1   public void test_some_functionality ( ) {
    2       // ...
    3       J D i a l o g O p e r a t o r myDialog = new J D i a l o g O p e r a t o r ( " E r r o r " ) ;
    4       // ...
    5   }



                                                 Pawel Prokop              Jemmy Introduction
GUI testing methods
                                                   Jemmy
                                                                      Screenshot
                                           Implementation
                                                                      Dump componenets
                                                  Features
                                                     Tools



Screenshot feature

        Capture screen shot
    1   // ...
    2   @Test
    3   public void testSomeFunctionality ( ) {
    4       // ...
    5       org . netbeans . jemmy . u t i l . PNGEncoder
    6             . captureScreen ( " t e s t S o m e F u n c t i o n a l i t y . png " ) ;
    7       // ...
    8   }
    9   // ...



        Image modes
                 black and white
                 grayscale
                 colour


                                              Pawel Prokop            Jemmy Introduction
GUI testing methods
                                             Jemmy
                                                           Screenshot
                                     Implementation
                                                           Dump componenets
                                            Features
                                               Tools


Dump components in JVM
  Dump components in JVM
     Dump all components
   1   //   ...
   2         @Test
   3         public void testSomeFunctionality ( ) {
   4             // ...
   5             org . netbeans . jemmy . u t i l . Dumper . dumpAll ( " jemmy_example . xml " ) ;
   6             // ...
   7         }
   8   //   ...


       Dump component
   1   // ...
   2   public void testSomeFunctionality ( ) {
   3       // ...
   4       Component comp = a p p l i c a t i o n . getMainFrame ( ) . getComponent ( 0 ) ;
   5           org . netbeans . jemmy . u t i l . Dumper . dumpComponent ( comp ,
   6                 " jemmy_example_component . xml " ) ;
   7       // ...
   8   }
   9   // ...


                                       Pawel Prokop        Jemmy Introduction
GUI testing methods
                               Jemmy
                       Implementation    GUIBrowser tool
                              Features
                                 Tools



GUIBrowser tool



     shows all GUI objects in current JVM
     shows components in hierarchy
     allows to take snapshot in defined time delay
     displays component members (name, caption, size...)




                        Pawel Prokop     Jemmy Introduction
GUI testing methods
                                                Jemmy
                                        Implementation           GUIBrowser tool
                                               Features
                                                  Tools



Launch GUIBrowser tool




1   new ClassReference ( " org . netbeans . jemmy . e x p l o r e r . GUIBrowser " ) . s t a r t A p p l i c a t i o n ( ) ;




                                           Pawel Prokop          Jemmy Introduction
GUI testing methods
                            Jemmy
                    Implementation    GUIBrowser tool
                           Features
                              Tools



Questions?




  Questions?




                     Pawel Prokop     Jemmy Introduction
GUI testing methods
                                     Jemmy
                             Implementation    GUIBrowser tool
                                    Features
                                       Tools


Links



    1.   Operators:
         http://wiki.netbeans.org/Jemmy_Operators_Environment

    2.   Jemmy repository: https://svn.java.net/svn/jemmy~svn

    3.   Jemmy tutorial: http://wiki.netbeans.org/Jemmy_Tutorial

    4.   this presentation: http://prokop.ae.krakow.pl/projects/download/
         jemmy_introduction.pdf




                              Pawel Prokop     Jemmy Introduction
GUI testing methods
                                         Jemmy
                                 Implementation    GUIBrowser tool
                                        Features
                                           Tools



Credits




    1. flickr/ant/binux
    2. flickr/clock/kobiz7




                                  Pawel Prokop     Jemmy Introduction

More Related Content

What's hot

Effective testing with pytest
Effective testing with pytestEffective testing with pytest
Effective testing with pytestHector Canto
 
Unit testing best practices
Unit testing best practicesUnit testing best practices
Unit testing best practicesnickokiss
 
Unit Testing Concepts and Best Practices
Unit Testing Concepts and Best PracticesUnit Testing Concepts and Best Practices
Unit Testing Concepts and Best PracticesDerek Smith
 
Robot Framework Dos And Don'ts
Robot Framework Dos And Don'tsRobot Framework Dos And Don'ts
Robot Framework Dos And Don'tsPekka Klärck
 
Practical Sikuli: using screenshots for GUI automation and testing
Practical Sikuli: using screenshots for GUI automation and testingPractical Sikuli: using screenshots for GUI automation and testing
Practical Sikuli: using screenshots for GUI automation and testingvgod
 
Page Object Model and Implementation in Selenium
Page Object Model and Implementation in Selenium  Page Object Model and Implementation in Selenium
Page Object Model and Implementation in Selenium Zoe Gilbert
 
A Not-So-Serious Introduction to Test Driven Development (TDD)
A Not-So-Serious Introduction to Test Driven Development (TDD) A Not-So-Serious Introduction to Test Driven Development (TDD)
A Not-So-Serious Introduction to Test Driven Development (TDD) CodeOps Technologies LLP
 
API Test Automation Tips and Tricks
API Test Automation Tips and TricksAPI Test Automation Tips and Tricks
API Test Automation Tips and Trickstesthive
 
ATDD Using Robot Framework
ATDD Using Robot FrameworkATDD Using Robot Framework
ATDD Using Robot FrameworkPekka Klärck
 
Clean code - smells and heuristics
Clean code - smells and heuristicsClean code - smells and heuristics
Clean code - smells and heuristicsThuc Le Dong
 
Introduction to testing with MSTest, Visual Studio, and Team Foundation Serve...
Introduction to testing with MSTest, Visual Studio, and Team Foundation Serve...Introduction to testing with MSTest, Visual Studio, and Team Foundation Serve...
Introduction to testing with MSTest, Visual Studio, and Team Foundation Serve...Thomas Weller
 

What's hot (20)

Effective testing with pytest
Effective testing with pytestEffective testing with pytest
Effective testing with pytest
 
Unit testing best practices
Unit testing best practicesUnit testing best practices
Unit testing best practices
 
Mockito
MockitoMockito
Mockito
 
Unit Testing (C#)
Unit Testing (C#)Unit Testing (C#)
Unit Testing (C#)
 
Unit Testing Concepts and Best Practices
Unit Testing Concepts and Best PracticesUnit Testing Concepts and Best Practices
Unit Testing Concepts and Best Practices
 
Robot Framework Dos And Don'ts
Robot Framework Dos And Don'tsRobot Framework Dos And Don'ts
Robot Framework Dos And Don'ts
 
JUNit Presentation
JUNit PresentationJUNit Presentation
JUNit Presentation
 
Practical Sikuli: using screenshots for GUI automation and testing
Practical Sikuli: using screenshots for GUI automation and testingPractical Sikuli: using screenshots for GUI automation and testing
Practical Sikuli: using screenshots for GUI automation and testing
 
Page Object Model and Implementation in Selenium
Page Object Model and Implementation in Selenium  Page Object Model and Implementation in Selenium
Page Object Model and Implementation in Selenium
 
Sikuli Slides
Sikuli SlidesSikuli Slides
Sikuli Slides
 
A Not-So-Serious Introduction to Test Driven Development (TDD)
A Not-So-Serious Introduction to Test Driven Development (TDD) A Not-So-Serious Introduction to Test Driven Development (TDD)
A Not-So-Serious Introduction to Test Driven Development (TDD)
 
API Test Automation Tips and Tricks
API Test Automation Tips and TricksAPI Test Automation Tips and Tricks
API Test Automation Tips and Tricks
 
Scripting robot
Scripting robotScripting robot
Scripting robot
 
Introduction to Robot Framework
Introduction to Robot FrameworkIntroduction to Robot Framework
Introduction to Robot Framework
 
2004 ARMADA OWNER'S MANUAL
2004 ARMADA OWNER'S MANUAL2004 ARMADA OWNER'S MANUAL
2004 ARMADA OWNER'S MANUAL
 
Testing Angular
Testing AngularTesting Angular
Testing Angular
 
ATDD Using Robot Framework
ATDD Using Robot FrameworkATDD Using Robot Framework
ATDD Using Robot Framework
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 
Clean code - smells and heuristics
Clean code - smells and heuristicsClean code - smells and heuristics
Clean code - smells and heuristics
 
Introduction to testing with MSTest, Visual Studio, and Team Foundation Serve...
Introduction to testing with MSTest, Visual Studio, and Team Foundation Serve...Introduction to testing with MSTest, Visual Studio, and Team Foundation Serve...
Introduction to testing with MSTest, Visual Studio, and Team Foundation Serve...
 

Viewers also liked

01 introduction E-Commerce
01 introduction E-Commerce01 introduction E-Commerce
01 introduction E-CommerceNirbhay Singh
 
Design for Social Sharing Workshop
Design for Social Sharing WorkshopDesign for Social Sharing Workshop
Design for Social Sharing WorkshopRashmi Sinha
 
Las Vegas - July 2008, Travel Digest
Las Vegas - July 2008, Travel DigestLas Vegas - July 2008, Travel Digest
Las Vegas - July 2008, Travel DigestSarah Wrightson
 
In A Clean City, A Healthy Life Project
In A Clean City, A Healthy Life ProjectIn A Clean City, A Healthy Life Project
In A Clean City, A Healthy Life ProjectOlga Morozan
 
What color do you like
What color do you likeWhat color do you like
What color do you likeorncn
 
Normicka's business cards
Normicka's business cardsNormicka's business cards
Normicka's business cardsnormicka
 
P1(2016)ustidham qiraati 4 july 2015
P1(2016)ustidham qiraati 4 july 2015P1(2016)ustidham qiraati 4 july 2015
P1(2016)ustidham qiraati 4 july 2015noorishamirsyad
 
Thermal Management And Sd0802 C Presentation
Thermal Management And Sd0802 C PresentationThermal Management And Sd0802 C Presentation
Thermal Management And Sd0802 C Presentationsforman1
 
Peterson 1klass2
Peterson 1klass2Peterson 1klass2
Peterson 1klass2qwasar1
 
Baiguullaga organition 2012
Baiguullaga organition 2012Baiguullaga organition 2012
Baiguullaga organition 2012oyundariubuns
 
Quiz for ut iii pps
Quiz for ut iii ppsQuiz for ut iii pps
Quiz for ut iii ppsshajugeorge
 
Top Thirty Global Media Owners 2014
Top Thirty Global Media Owners 2014Top Thirty Global Media Owners 2014
Top Thirty Global Media Owners 2014Performics
 
Rba impian-guide-sept-20132
Rba impian-guide-sept-20132Rba impian-guide-sept-20132
Rba impian-guide-sept-20132burhan fuady
 
Transactional learning and simulations: how far can we go in professional leg...
Transactional learning and simulations: how far can we go in professional leg...Transactional learning and simulations: how far can we go in professional leg...
Transactional learning and simulations: how far can we go in professional leg...York University - Osgoode Hall Law School
 
file handling1
file handling1file handling1
file handling1student
 

Viewers also liked (20)

SWTBot Tutorial
SWTBot TutorialSWTBot Tutorial
SWTBot Tutorial
 
WindowTester PRO
WindowTester PROWindowTester PRO
WindowTester PRO
 
Tambah
TambahTambah
Tambah
 
01 introduction E-Commerce
01 introduction E-Commerce01 introduction E-Commerce
01 introduction E-Commerce
 
Bebepolis
BebepolisBebepolis
Bebepolis
 
Design for Social Sharing Workshop
Design for Social Sharing WorkshopDesign for Social Sharing Workshop
Design for Social Sharing Workshop
 
Las Vegas - July 2008, Travel Digest
Las Vegas - July 2008, Travel DigestLas Vegas - July 2008, Travel Digest
Las Vegas - July 2008, Travel Digest
 
In A Clean City, A Healthy Life Project
In A Clean City, A Healthy Life ProjectIn A Clean City, A Healthy Life Project
In A Clean City, A Healthy Life Project
 
What color do you like
What color do you likeWhat color do you like
What color do you like
 
Normicka's business cards
Normicka's business cardsNormicka's business cards
Normicka's business cards
 
P1(2016)ustidham qiraati 4 july 2015
P1(2016)ustidham qiraati 4 july 2015P1(2016)ustidham qiraati 4 july 2015
P1(2016)ustidham qiraati 4 july 2015
 
Thermal Management And Sd0802 C Presentation
Thermal Management And Sd0802 C PresentationThermal Management And Sd0802 C Presentation
Thermal Management And Sd0802 C Presentation
 
Peterson 1klass2
Peterson 1klass2Peterson 1klass2
Peterson 1klass2
 
Baiguullaga organition 2012
Baiguullaga organition 2012Baiguullaga organition 2012
Baiguullaga organition 2012
 
Quiz for ut iii pps
Quiz for ut iii ppsQuiz for ut iii pps
Quiz for ut iii pps
 
Top Thirty Global Media Owners 2014
Top Thirty Global Media Owners 2014Top Thirty Global Media Owners 2014
Top Thirty Global Media Owners 2014
 
Rba impian-guide-sept-20132
Rba impian-guide-sept-20132Rba impian-guide-sept-20132
Rba impian-guide-sept-20132
 
Transactional learning and simulations: how far can we go in professional leg...
Transactional learning and simulations: how far can we go in professional leg...Transactional learning and simulations: how far can we go in professional leg...
Transactional learning and simulations: how far can we go in professional leg...
 
file handling1
file handling1file handling1
file handling1
 
Pk std
Pk stdPk std
Pk std
 

Similar to Jemmy Introduction

Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...Sauce Labs
 
How We Built Test Automation within a Manual Testing Organization
How We Built Test Automation within a Manual Testing OrganizationHow We Built Test Automation within a Manual Testing Organization
How We Built Test Automation within a Manual Testing OrganizationAn Doan
 
San Jose Selenium Meet-up PushToTest TestMaker Presentation
San Jose Selenium Meet-up PushToTest TestMaker PresentationSan Jose Selenium Meet-up PushToTest TestMaker Presentation
San Jose Selenium Meet-up PushToTest TestMaker PresentationClever Moe
 
081107 Sammy Eclipse Summit2
081107   Sammy   Eclipse Summit2081107   Sammy   Eclipse Summit2
081107 Sammy Eclipse Summit2mkempka
 
Selenium - automated browser-based testing -
Selenium - automated browser-based testing -Selenium - automated browser-based testing -
Selenium - automated browser-based testing -Seiji KOMATSU
 
ICTSS 2010 - Iterative Software Testing Process for Scrum and Waterfall Projects
ICTSS 2010 - Iterative Software Testing Process for Scrum and Waterfall ProjectsICTSS 2010 - Iterative Software Testing Process for Scrum and Waterfall Projects
ICTSS 2010 - Iterative Software Testing Process for Scrum and Waterfall ProjectsEliane Collins
 
Performance testing with jmeter
Performance testing with jmeter Performance testing with jmeter
Performance testing with jmeter Knoldus Inc.
 
Automated Web Testing Using Selenium
Automated Web Testing Using SeleniumAutomated Web Testing Using Selenium
Automated Web Testing Using SeleniumWeifeng Zhang
 
Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by ExampleNalin Goonawardana
 
TAME-Test Automation Made Easy
TAME-Test Automation Made EasyTAME-Test Automation Made Easy
TAME-Test Automation Made EasyAnmol Bagga
 
Selenium Basics Tutorial
Selenium Basics TutorialSelenium Basics Tutorial
Selenium Basics TutorialClever Moe
 
James Lyndsay - Testing in an agile environment
James Lyndsay - Testing in an agile environmentJames Lyndsay - Testing in an agile environment
James Lyndsay - Testing in an agile environmentDavid O'Dowd
 
TDD in functional testing with WebDriver
TDD in functional testing with WebDriverTDD in functional testing with WebDriver
TDD in functional testing with WebDriverMikalai Alimenkou
 
Developer Experience to Testing
Developer Experience to TestingDeveloper Experience to Testing
Developer Experience to TestingMozaic Works
 

Similar to Jemmy Introduction (20)

Unit Testing
Unit TestingUnit Testing
Unit Testing
 
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
 
Automated testing web application
Automated testing web applicationAutomated testing web application
Automated testing web application
 
How We Built Test Automation within a Manual Testing Organization
How We Built Test Automation within a Manual Testing OrganizationHow We Built Test Automation within a Manual Testing Organization
How We Built Test Automation within a Manual Testing Organization
 
11 software testing_strategy
11 software testing_strategy11 software testing_strategy
11 software testing_strategy
 
San Jose Selenium Meet-up PushToTest TestMaker Presentation
San Jose Selenium Meet-up PushToTest TestMaker PresentationSan Jose Selenium Meet-up PushToTest TestMaker Presentation
San Jose Selenium Meet-up PushToTest TestMaker Presentation
 
081107 Sammy Eclipse Summit2
081107   Sammy   Eclipse Summit2081107   Sammy   Eclipse Summit2
081107 Sammy Eclipse Summit2
 
Selenium - automated browser-based testing -
Selenium - automated browser-based testing -Selenium - automated browser-based testing -
Selenium - automated browser-based testing -
 
Testing in java
Testing in javaTesting in java
Testing in java
 
ICTSS 2010 - Iterative Software Testing Process for Scrum and Waterfall Projects
ICTSS 2010 - Iterative Software Testing Process for Scrum and Waterfall ProjectsICTSS 2010 - Iterative Software Testing Process for Scrum and Waterfall Projects
ICTSS 2010 - Iterative Software Testing Process for Scrum and Waterfall Projects
 
j meter
 j meter j meter
j meter
 
Performance testing with jmeter
Performance testing with jmeter Performance testing with jmeter
Performance testing with jmeter
 
Automated Web Testing Using Selenium
Automated Web Testing Using SeleniumAutomated Web Testing Using Selenium
Automated Web Testing Using Selenium
 
Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by Example
 
TAME-Test Automation Made Easy
TAME-Test Automation Made EasyTAME-Test Automation Made Easy
TAME-Test Automation Made Easy
 
Selenium Basics Tutorial
Selenium Basics TutorialSelenium Basics Tutorial
Selenium Basics Tutorial
 
James Lyndsay - Testing in an agile environment
James Lyndsay - Testing in an agile environmentJames Lyndsay - Testing in an agile environment
James Lyndsay - Testing in an agile environment
 
TDD in functional testing with WebDriver
TDD in functional testing with WebDriverTDD in functional testing with WebDriver
TDD in functional testing with WebDriver
 
Testing
TestingTesting
Testing
 
Developer Experience to Testing
Developer Experience to TestingDeveloper Experience to Testing
Developer Experience to Testing
 

Recently uploaded

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 

Recently uploaded (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 

Jemmy Introduction

  • 1. GUI testing methods Jemmy Implementation Features Tools Jemmy tutorial Introduction to Jemmy testing framework Pawel Prokop pawel.prokop@adfinem.net http://prokop.uek.krakow.pl March 14, 2012 Pawel Prokop Jemmy Introduction
  • 2. GUI testing methods Jemmy Recording tests Implementation Testing frameworks Features Summary Tools Manualy testing error prone slow and not efficient repeating test costs a lot no place for TDD boring for developers (dinner syndrome) flexible look & feel fast feedback Pawel Prokop Jemmy Introduction
  • 3. GUI testing methods Jemmy Recording tests Implementation Testing frameworks Features Summary Tools Recording user actions to exercise the application efficient fast preparation fast execution cheap hard to modify during application development common functionalities no place for TDD Pawel Prokop Jemmy Introduction
  • 4. GUI testing methods Jemmy Recording tests Implementation Testing frameworks Features Summary Tools Available tools for test recording SWTBot is an open-source Java based functional testing tool for testing SWT and Eclipse based applications. http://www.eclipse.org/swtbot/ Marathon allows to record the script that can be modified later manualy. Supports assertions. www.marathontesting.com/ Jacareto is a tool that allows capture actions on applications and replay them later. http://jacareto.sourceforge.net/wiki Pawel Prokop Jemmy Introduction
  • 5. GUI testing methods Jemmy Recording tests Implementation Testing frameworks Features Summary Tools Write code that simulates user actions efficient moderate slow preparation parts of code may be reused fast execution easy to modify during application development can be used with TDD Pawel Prokop Jemmy Introduction
  • 6. GUI testing methods Jemmy Recording tests Implementation Testing frameworks Features Summary Tools Testing frameworks UISpec4J is an open source framework to test Swing applications. http://www.uispec4j.org/ JFCUnit is an extension of JUnit that allows to execute unit tests against Swing based interface. http://jfcunit.sourceforge.net/ Jemmy is an open source framework that allows to simulate user interactions with Swing applications. https://svn.java.net/svn/jemmy~svn Pawel Prokop Jemmy Introduction
  • 7. GUI testing methods Jemmy Recording tests Implementation Testing frameworks Features Summary Tools Summary Manual testing Recording Framework Efficiency - + + Preparation time + + +/- Execution time - + + Price - + + Reusability - - + TDD - - + Flexibility + - - Pawel Prokop Jemmy Introduction
  • 8. GUI testing methods Jemmy Introduction Implementation Installation Features Tools Jemmy introduction Jemmy documentation not so many tutorials not so many presentations and documents good javadoc is enough to start few samples low Jemmy vitality Pawel Prokop Jemmy Introduction
  • 9. GUI testing methods Jemmy Introduction Implementation Installation Features Tools Jemmy framework How Jemmy works? the same JVM as tested application simulates user operations on the components by calling events events are stored on the QueueTool class and then provided to AWT EventQueue search components recursively by given criteria (caption, name) criteria defined as implementation of ComponentChooser interface Pawel Prokop Jemmy Introduction
  • 10. GUI testing methods Jemmy Introduction Implementation Installation Features Tools Jemmy framework Jemmy in TDD approach design UI interface and the components implement jemmy tests to fit the interface run failing tests create implementation and re-run tests until they pass Pawel Prokop Jemmy Introduction
  • 11. GUI testing methods Jemmy Introduction Implementation Installation Features Tools Jemmy Installation Eclipse add jemmy.jar to the Java Build Path Pawel Prokop Jemmy Introduction
  • 12. GUI testing methods Jemmy Introduction Implementation Installation Features Tools Jemmy Installation Netbeans add Jar/Folder to Libraries Pawel Prokop Jemmy Introduction
  • 13. GUI testing methods Jemmy Introduction Implementation Installation Features Tools Integration with JUnit 1 @Ignore 2 p u b l i c c l a s s CommonTest { 3 protected s t a t i c JMyApplication a p p l i c a t i o n = n u l l ; 4 5 p u b l i c CommonTest ( ) { } 6 7 @BeforeClass 8 p u b l i c s t a t i c v o i d setUpClass ( ) throws E x c e p ti o n { } 9 10 @AfterClass 11 p u b l i c s t a t i c v o i d tearDownClass ( ) throws E x c e p ti o n { } 12 13 @Before 14 p u b l i c v o i d setUp ( ) throws E x c e p ti o n { 15 a p p l i c a t i o n = new J M y A p p l i c a t i o n ( ) ; 16 a p p l i c a t i o n . startJMyForms ( ) ; 17 } 18 19 @After 20 p u b l i c v o i d tearDown ( ) throws E x c e p ti o n { 21 a p p l i c a t i o n . stopJMyForms ( ) ; 22 } 23 } Pawel Prokop Jemmy Introduction
  • 14. GUI testing methods Jemmy Introduction Implementation Installation Features Tools Integration with Ant Pawel Prokop Jemmy Introduction
  • 15. GUI testing methods Jemmy Introduction Implementation Installation Features Tools Integration with Ant 1 < p r o j e c t name= " JemmySample " > 2 < t a r g e t name= " j u n i t " > 3 < j u n i t printsummary= " yes " > 4 < c l a s s p a t h path= " l i b s / j u n i t −4.5. j a r " / > 5 < c l a s s p a t h path= " l i b s / jemmy . j a r " / > 6 < c l a s s p a t h path= " b u i l d / t e s t / c l a s s e s / " / > 7 < c l a s s p a t h path= " b u i l d / c l a s s e s / " / > 8 < b a t c h t e s t f o r k = " yes " > 9 < f i l e s e t d i r = " t e s t " i n c l u d e s = " ∗∗/∗ Test . j a v a " / > 10 </ batchtest> 11 </ junit> 12 </ target> 13 </ project> 1 a n t −f j u n i t . xml j u n i t Pawel Prokop Jemmy Introduction
  • 16. GUI testing methods Operators Jemmy Concept depended approach Implementation Component choosers Features Timeouts Tools Find components Operators Communication with UI controls is realized by operators Jemmy defines own operators for every AWT/Swing UI component JFrameOperator JDialogOperator JButtonOperator JCheckBoxOperator JComboBoxOperator JFileChooserOperator ...and many others Operators can be extended by the developer Pawel Prokop Jemmy Introduction
  • 17. GUI testing methods Operators Jemmy Concept depended approach Implementation Component choosers Features Timeouts Tools Find components Operators - small example Yes/No dialog operator 1 p u b l i c c l a s s YesNoDialogOperator extends J D i a l o g O p e r a t o r { 2 p u b l i c YesNoDialogOperator ( ) { 3 super ( " C o n f i r m a t i o n " ) ; 4 } 5 6 p u b l i c v o i d pushYes ( ) { 7 new J B u t t o n O p e r a t o r ( t h i s , " Yes " ) . push ( ) ; 8 } 9 10 p u b l i c v o i d pushNo ( ) { 11 new J B u t t o n O p e r a t o r ( t h i s , "No" ) . push ( ) ; 12 } 13 } Pawel Prokop Jemmy Introduction
  • 18. GUI testing methods Operators Jemmy Concept depended approach Implementation Component choosers Features Timeouts Tools Find components Operators - small example Usage 1 // ... 2 @Test 3 public void test_some_functionality ( ) { 4 // ... 5 YesNoDialogOperator o p e r a t o r = new YesNoDialogOperator ( ) ; 6 assertNotNull ( operator ) ; 7 o p e r a t o r . pushYes ( ) ; 8 // ... 9 } 10 // ... Pawel Prokop Jemmy Introduction
  • 19. GUI testing methods Operators Jemmy Concept depended approach Implementation Component choosers Features Timeouts Tools Find components Load application with jemmy class reference 1 new ClassReference ( " jemmysample . JemmySampleApplication " ) . s t a r t A p p l i c a t i o n ( ) ; direct call 1 JemmySampleApplication . main ( n u l l ) ; Pawel Prokop Jemmy Introduction
  • 20. GUI testing methods Operators Jemmy Concept depended approach Implementation Component choosers Features Timeouts Tools Find components Concept depended approach create classes that support some application’s functionality: 1 c l a s s MyMainDialog extends J D i a l o g O p e r a t o r { 2 p u b l i c s t a t i c S t r i n g d i a l o g C a p t i o n = "My D i a l o g " ; 3 4 p u b l i c MyMainDialog ( ) { super ( d i a l o g C a p t i o n ) ; } 5 6 p u b l i c v o i d pushButtonCancel ( ) { 7 new J B u t t o n O p e r a t o r ( " Cancel " ) . push ( ) ; 8 } 9 } and then use them from test suites: 1 @Test 2 public void test_dialog_can_cancel ( ) { 3 MyMainDialog d i a l o g O p e r a t o r = new MyMainDialog ( ) ; 4 d i a l o g O p e r a t o r . pushButtonCancel ( ) ; 5 } Pawel Prokop Jemmy Introduction
  • 21. GUI testing methods Operators Jemmy Concept depended approach Implementation Component choosers Features Timeouts Tools Find components Application Shadow 1 public class JMyApplication { 2 p r i v a t e JFrameOperator mainFrame = n u l l ; 3 4 p u b l i c JFrameOperator getMainFrame ( ) { 5 r e t u r n mainFrame ; 6 } 7 8 p u b l i c i n t startJMyForms ( ) { 9 JemmySampleApplication . main ( n u l l ) ; 10 mainFrame = new JFrameOperator ( " JMyForms " ) ; 11 return 0; 12 } 13 14 p u b l i c i n t stopJMyForms ( ) { 15 JMenuBarOperator menuBarOp = new JMenuBarOperator ( mainFrame ) ; 16 JMenuOperator f i l e M e n u = new JMenuOperator ( menuBarOp . getMenu ( 0 ) ) ; 17 f i l e M e n u . pushMenu ( " F i l e | E x i t " ) ; 18 return 0; 19 } 20 } Pawel Prokop Jemmy Introduction
  • 22. GUI testing methods Operators Jemmy Concept depended approach Implementation Component choosers Features Timeouts Tools Find components The Component Choosers How to find component? using its index inside the container textfield next to label using Component Chooser implementation NameComponentChooser uses a name property PropChooser uses properties and methods to match a component Developer can define custom component choosers - implementing ComponentChooser interface Pawel Prokop Jemmy Introduction
  • 23. GUI testing methods Operators Jemmy Concept depended approach Implementation Component choosers Features Timeouts Tools Find components RegexpFrameTitleChooser 1 p u b l i c c l a s s RegexpFrameTitleChooser implements ComponentChooser { 2 Pattern pattern = n u l l ; 3 4 p u b l i c RegexpFrameTitleChooser ( S t r i n g p a t t e r n ) { 5 t h i s . p a t t e r n = P a t t e r n . compile ( p a t t e r n ) ; 6 } 7 8 @Override 9 p u b l i c boolean checkComponent ( Component component ) { 10 i f ( component i n s t a n c e o f JFrame ) { 11 S t r i n g f r a m e T i t l e = ( ( JFrame ) component ) . g e t T i t l e ( ) ; 12 Matcher matcher = p a t t e r n . matcher ( f r a m e T i t l e ) ; 13 r e t u r n matcher . matches ( ) ; 14 } 15 return false ; 16 } 17 18 @Override 19 public String getDescription ( ) { 20 return pattern . pattern ( ) ; 21 } 22 } Pawel Prokop Jemmy Introduction
  • 24. GUI testing methods Operators Jemmy Concept depended approach Implementation Component choosers Features Timeouts Tools Find components ShowingComponentChooser 1 p u b l i c c l a s s ShowingNameComponentChooser extends NameComponentChooser { 2 p u b l i c ShowingNameComponentChooser ( S t r i n g name ) { 3 super ( name ) ; 4 } 5 6 @Override 7 p u b l i c boolean checkComponent ( Component component ) { 8 i f ( super . checkComponent ( component ) && component . isShowing ( ) ) { 9 return true ; 10 } 11 return false ; 12 } 13 14 15 16 } Pawel Prokop Jemmy Introduction
  • 25. GUI testing methods Operators Jemmy Concept depended approach Implementation Component choosers Features Timeouts Tools Find components Timeouts time values (millisec- onds) to wait for something to be done by the application Pawel Prokop Jemmy Introduction
  • 26. GUI testing methods Operators Jemmy Concept depended approach Implementation Component choosers Features Timeouts Tools Find components Timeouts to delay simulated user behaviour kept by org.netbeans.jemmy.Timeouts class 1 / / Set d e l a y b e f o r e key i s pressed d u r i n g t y p i n g 2 JemmyProperties . g e t C u r r e n t T i m e o u t s ( ) . setTimeout 3 ( " JTextComponentOperator . PushKeyTimeout " , 5 0 ) ; each instance can have its own timeouts set 1 / / Set d e l a y between b u t t o n p r e s s i n g and r e l e a s i n g . 2 J B u t t o n O p e r a t o r b t n O p e r a t o r = new J B u t t o n O p e r a t o r ( " Process " ) ; 3 b t n O p e r a t o r . getTimeouts ( ) 4 . setTimeout ( " A b s t r a c t B u t t o n O p e r a t o r . PushButtonTimeout " , 5 0 0 ) ; Pawel Prokop Jemmy Introduction
  • 27. GUI testing methods Operators Jemmy Concept depended approach Implementation Component choosers Features Timeouts Tools Find components Timeouts cont. to wait until timeout exception is raised 1 / / w a i t up t o 5 seconds f o r J D i a l o g 2 JemmyProperties . g e t C u r r e n t T i m e o u t s ( ) . setTimeout 3 ( " D i a l o g W a i t e r . WaitDialogTimeout " , 5 0 0 0 ) ; 4 J D i a l o g O p e r a t o r albums = new J D i a l o g O p e r a t o r ( " D i a l o g Caption " ) ; Pawel Prokop Jemmy Introduction
  • 28. GUI testing methods Operators Jemmy Concept depended approach Implementation Component choosers Features Timeouts Tools Find components More timeouts JComboBoxOperator.BeforeSelectingTimeout - time to sleep after list opened and before item selected JComboBoxOperator.WaitListTimeout - time to wait list opened ComponentOperator.WaitStateTimeout - time to wait for item to be selected JTextComponentOperator.PushKeyTimeout - time between key pressing and releasing during text typing JTextComponentOperator.BetweenKeysTimeout - time to sleep between two chars typing Pawel Prokop Jemmy Introduction
  • 29. GUI testing methods Operators Jemmy Concept depended approach Implementation Component choosers Features Timeouts Tools Find components find method vs operator constructor static find method returns the operator or null immediately: 1 @Test 2 public void test_some_functionality ( ) { 3 // ... 4 J D i a l o g O p e r a t o r myDialog = J D i a l o g O p e r a t o r . f i n d D i a l o g ( " E r r o r " , t r u e , t r u e ) ; 5 i f ( n u l l == myDialog ) { 6 / / no E r r o r d i a l o g i s c u r r e n t l y d i s p l a y e d 7 } 8 // ... 9 } constructor blocks until component appears on the screen or timeout. 1 public void test_some_functionality ( ) { 2 // ... 3 J D i a l o g O p e r a t o r myDialog = new J D i a l o g O p e r a t o r ( " E r r o r " ) ; 4 // ... 5 } Pawel Prokop Jemmy Introduction
  • 30. GUI testing methods Jemmy Screenshot Implementation Dump componenets Features Tools Screenshot feature Capture screen shot 1 // ... 2 @Test 3 public void testSomeFunctionality ( ) { 4 // ... 5 org . netbeans . jemmy . u t i l . PNGEncoder 6 . captureScreen ( " t e s t S o m e F u n c t i o n a l i t y . png " ) ; 7 // ... 8 } 9 // ... Image modes black and white grayscale colour Pawel Prokop Jemmy Introduction
  • 31. GUI testing methods Jemmy Screenshot Implementation Dump componenets Features Tools Dump components in JVM Dump components in JVM Dump all components 1 // ... 2 @Test 3 public void testSomeFunctionality ( ) { 4 // ... 5 org . netbeans . jemmy . u t i l . Dumper . dumpAll ( " jemmy_example . xml " ) ; 6 // ... 7 } 8 // ... Dump component 1 // ... 2 public void testSomeFunctionality ( ) { 3 // ... 4 Component comp = a p p l i c a t i o n . getMainFrame ( ) . getComponent ( 0 ) ; 5 org . netbeans . jemmy . u t i l . Dumper . dumpComponent ( comp , 6 " jemmy_example_component . xml " ) ; 7 // ... 8 } 9 // ... Pawel Prokop Jemmy Introduction
  • 32. GUI testing methods Jemmy Implementation GUIBrowser tool Features Tools GUIBrowser tool shows all GUI objects in current JVM shows components in hierarchy allows to take snapshot in defined time delay displays component members (name, caption, size...) Pawel Prokop Jemmy Introduction
  • 33. GUI testing methods Jemmy Implementation GUIBrowser tool Features Tools Launch GUIBrowser tool 1 new ClassReference ( " org . netbeans . jemmy . e x p l o r e r . GUIBrowser " ) . s t a r t A p p l i c a t i o n ( ) ; Pawel Prokop Jemmy Introduction
  • 34. GUI testing methods Jemmy Implementation GUIBrowser tool Features Tools Questions? Questions? Pawel Prokop Jemmy Introduction
  • 35. GUI testing methods Jemmy Implementation GUIBrowser tool Features Tools Links 1. Operators: http://wiki.netbeans.org/Jemmy_Operators_Environment 2. Jemmy repository: https://svn.java.net/svn/jemmy~svn 3. Jemmy tutorial: http://wiki.netbeans.org/Jemmy_Tutorial 4. this presentation: http://prokop.ae.krakow.pl/projects/download/ jemmy_introduction.pdf Pawel Prokop Jemmy Introduction
  • 36. GUI testing methods Jemmy Implementation GUIBrowser tool Features Tools Credits 1. flickr/ant/binux 2. flickr/clock/kobiz7 Pawel Prokop Jemmy Introduction