SlideShare a Scribd company logo
SIKULI
USING SCREENSHOTS FOR GUI
 AUTOMATION AND TESTING
 Tsung-Hsiang (Sean) Chang, Rob Miller
              MIT CSAIL


    Collaborator: Tom Yeh

                   1
How to
tell computers what to do?



            2
case $rtval in
                         1) rm -f /tmp/dirip.$$ ; return ;;
                         255) rm -f /tmp/dirip.$$ ; return ;;
                    esac

                    mfile=`cat /tmp/dirip.$$`

                    if [ -z $mfile ]
                    then
                         mfile=`pwd`/*


SHELL SCRIPT
                    else
                         grep "*" /tmp/dirip.$$
                         if [ $? -eq 1 ]
                         then
                   ! mfile=$mfile/*
                         fi
                    fi

                    for i in $mfile
                    do
                       if [ -f $i ]
                       then
                   ! echo "$i Delete?" >> /tmp/finallist.$$
                       fi!
                    done




               3
4
GUI AUTOMATION




      5
2

    3


            1

6
7
click   click




           7
SIKULI SCRIPT
      8
SIKULI TEST
     9
OUTLINE
• Problem     - How to refer to a GUI widget?

• Sikuli   Script - examples and demos

• Sikuli Test   - demo

  • Test   By Demonstration

  • Support     of testing practices

• Conclusions

                                       10
HOW TO REFER TO A GUI WIDGET?




              11
HOW TO REFER TO A GUI WIDGET?


<AWTTestScript>                      Abbot
 <launch classpath="src/demo" args="[]"
   class="CelsiusConverter" method="main" />
 <action args="45" method="actionKeyString"/>
 <action class="javax.swing.AbstractButton"
  args="Convert..." method="actionClick"/>
 <assert value="113 Fahrenheit"
      component="113 Fahrenheit"
      method="getText"/>
    by pre-programmed references
 <terminate/>
</AWTTestScript>




                                                11
HOW TO REFER TO A GUI WIDGET?


<AWTTestScript>                      Abbot
 <launch classpath="src/demo" args="[]"
                                                                             Autoit
   class="CelsiusConverter" method="main" />
 <action args="45" method="actionKeyString"/>
 <action class="javax.swing.AbstractButton"
  args="Convert..." method="actionClick"/>
 <assert value="113 Fahrenheit"
      component="113 Fahrenheit"
      method="getText"/>
    by pre-programmed references
 <terminate/>                                        by absolute locations
</AWTTestScript>




                                                11
Use Screenshots!



       12
TEMPLATE MATCHING

click(	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  )




                                                                  13
TEMPLATE MATCHING

click(	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  )




                                                                  13
EXAMPLE 1:
EMPTY TRASH CAN
                  2

            3


                      1
       14
EX2: FACEBOOK STALKER




          15
EX2: FACEBOOK STALKER




          15
16
RESTRICT SEARCH REGION




          17
EX3: MUTE SPEAKERS




        18
EX3: MUTE SPEAKERS




        18
SPATIAL OPERATORS




        19
SPATIAL OPERATORS




        19
SPATIAL OPERATORS (2)




          20
EX4: SET IP ADDRESS




         21
VISUAL-EVENT-DRIVEN
   PROGRAMMING




         22
VISUAL-EVENT-DRIVEN
   PROGRAMMING




         22
SIKULI TEST



     23
VISUAL ASSERTION
• Verify   appearance




                        24
VISUAL ASSERTION
• Verify   replacement




                         25
TEST BY DEMONSTRATION
               detect changes

click




          26
Demo



 27
GENERATE ACTION
                COMMANDS


mouse mouse
               ‘A’ ‘A’ ‘b’ ‘b’
down   up
              down up down up




                                 28
GENERATE ACTION
                COMMANDS

                                      low-level events

mouse mouse
               ‘A’ ‘A’ ‘b’ ‘b’
down   up
              down up down up




                                 28
GENERATE ACTION
                COMMANDS

                                      low-level events

mouse mouse
               ‘A’ ‘A’ ‘b’ ‘b’
down   up
              down up down up
                                          high-level
                                         commands
   click         type “Ab”




                                 28
GENERATE ACTION
                COMMANDS

                                              low-level events

mouse mouse
down   up
               ‘A’ ‘A’ ‘b’ ‘b’        click
              down up down up
                                                  high-level
                                                 commands
   click         type “Ab”


                                               combine with
                                                screenshots
                                 28
GENERATE ASSERTIONS



              click




         29
GENERATE ASSERTIONS



                                          click

1. find differences / manually hint




                                     29
GENERATE ASSERTIONS



                                          click

1. find differences / manually hint
2. group together




                                     29
GENERATE ASSERTIONS



                                          click

1. find differences / manually hint
2. group together
3. combine with assertExist



                                     29
GENERATE ASSERTIONS



                                          click

1. find differences / manually hint
2. group together
3. combine with assertExist



                                     29
jUNIT INTEGRATION




        30
TEST-DRIVEN DEVELOPMENT




           31
READABILITY OF CODE




         32
PLATFORM INDEPENDENCE

• Works
      on ANY GUI that can be displayed on
 Windows/Linux/Mac

 • Virtual   machines

 • Remote     desktop

 • Mobile    simulators: Android, iPhone

 • Web: Flash, HTML+Javascript


                            33
34
34
LIMITATIONS
Theme Variations



                       Visibility Constraints




                        35
DISCUSSION
Sikuli programs are written against the user interface
instead of an API




	

   UI: visible, familiar, always exists
	

   API: faster, probably more stable



                                 36
FUTURE WORK


• fast   and accurate OCR on screen

• more    robust against different skins




                                 37
Thanks!


     http://sikuli.csail.mit.edu

      or, just google “sikuli”

                                            New Sikuli 0.10 released.
                                            Follow us on twitter @sikuli

Thanks to our funding sources: NSF and Quanta Computer (as a part of TParty project.)
                                           38

More Related Content

PDF
Practical Sikuli: using screenshots for GUI automation and testing
PPSX
Mateusz Radkiewicz - "Automate user's actions with Selenium, Auto it and Sikuli"
PPTX
Sikuli Slides
PDF
LibGDX: Cross Platform Game Development
PPTX
Beginning android games
PPTX
High End Modeling & Imaging with Intel Iris Pro Graphics
PDF
Building games-with-libgdx
PDF
libGDX: Screens, Fonts and Preferences
Practical Sikuli: using screenshots for GUI automation and testing
Mateusz Radkiewicz - "Automate user's actions with Selenium, Auto it and Sikuli"
Sikuli Slides
LibGDX: Cross Platform Game Development
Beginning android games
High End Modeling & Imaging with Intel Iris Pro Graphics
Building games-with-libgdx
libGDX: Screens, Fonts and Preferences

Viewers also liked (20)

PPTX
Exploring the internal state of user interfaces using sikuli
PPTX
PPSX
Sikuli script
PDF
Osc tokyo2010 fall_zfs
PPTX
Connected Prisons_Catalysts For Change Zone of Future Innovtion
PPTX
Diapositivas tegno
PPTX
Samenleving 2013 100610
PDF
Innomantra innovation & intellectual property - 2015 f9
PPTX
Gross Printed Product_Catalysts For Change Zone of Future Innovtion
PPTX
Hyper Urban Farming_Catalysts For Change Zone of Future Innovtion
PPTX
Innomantra - Intellectual Property Consulting & Services
PPTX
EzMate 401 Arise Biotech
PDF
As caras do entroido ourensan
PPT
Digtal media task guide
XLS
mundial sudafrica_2010
DOC
Metrar group protocolo de iluminacion -----2015
PPT
There &amp; Back Again
PDF
Aula android 04
PPTX
A&m assessment help
PDF
Tratado practico de fotografia industrial
Exploring the internal state of user interfaces using sikuli
Sikuli script
Osc tokyo2010 fall_zfs
Connected Prisons_Catalysts For Change Zone of Future Innovtion
Diapositivas tegno
Samenleving 2013 100610
Innomantra innovation & intellectual property - 2015 f9
Gross Printed Product_Catalysts For Change Zone of Future Innovtion
Hyper Urban Farming_Catalysts For Change Zone of Future Innovtion
Innomantra - Intellectual Property Consulting & Services
EzMate 401 Arise Biotech
As caras do entroido ourensan
Digtal media task guide
mundial sudafrica_2010
Metrar group protocolo de iluminacion -----2015
There &amp; Back Again
Aula android 04
A&m assessment help
Tratado practico de fotografia industrial
Ad

Similar to Sikuli: Using Screenshots for GUI Automation and Testing (20)

PDF
2011 py con
PDF
Master Your Tools (OpenValue Meetup june 2019)
PDF
Browser as a broadcast medium
PDF
2010 bb dev con
PDF
Cucumber meets iPhone
PDF
[CB16] About the cyber grand challenge: the world’s first all-machine hacking...
KEY
Rapid Testing, Rapid Development
PDF
KubeInvaders - Chaos Engineering Tool for Kubernetes and Openshift
PDF
Ict project pdf
PDF
Debugging Javascript - 0 to Heisenberg
PPTX
Basics of Programming using Scratch Platform
PDF
[QE 2017] Dawid Pacia, Tomasz Janiszewski - SQA w erze TestOps
PDF
Behavioural Driven Development in Zf2
PPTX
Node.js debugging
PPTX
Assembling an Open Source Toolchain to Manage Public, Private and Hybrid Clou...
PDF
The Joy Of Ruby
PPT
Space Mouse
KEY
Automated ui testing
PDF
State Of Ajax Zend Con 08
PDF
Reactive Thinking in iOS Development - Pedro Piñera Buendía - Codemotion Amst...
2011 py con
Master Your Tools (OpenValue Meetup june 2019)
Browser as a broadcast medium
2010 bb dev con
Cucumber meets iPhone
[CB16] About the cyber grand challenge: the world’s first all-machine hacking...
Rapid Testing, Rapid Development
KubeInvaders - Chaos Engineering Tool for Kubernetes and Openshift
Ict project pdf
Debugging Javascript - 0 to Heisenberg
Basics of Programming using Scratch Platform
[QE 2017] Dawid Pacia, Tomasz Janiszewski - SQA w erze TestOps
Behavioural Driven Development in Zf2
Node.js debugging
Assembling an Open Source Toolchain to Manage Public, Private and Hybrid Clou...
The Joy Of Ruby
Space Mouse
Automated ui testing
State Of Ajax Zend Con 08
Reactive Thinking in iOS Development - Pedro Piñera Buendía - Codemotion Amst...
Ad

Recently uploaded (20)

PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Approach and Philosophy of On baking technology
PDF
Encapsulation theory and applications.pdf
PPTX
A Presentation on Artificial Intelligence
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Empathic Computing: Creating Shared Understanding
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Spectroscopy.pptx food analysis technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
The Rise and Fall of 3GPP – Time for a Sabbatical?
Digital-Transformation-Roadmap-for-Companies.pptx
NewMind AI Weekly Chronicles - August'25-Week II
“AI and Expert System Decision Support & Business Intelligence Systems”
Approach and Philosophy of On baking technology
Encapsulation theory and applications.pdf
A Presentation on Artificial Intelligence
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Machine learning based COVID-19 study performance prediction
Advanced methodologies resolving dimensionality complications for autism neur...
Network Security Unit 5.pdf for BCA BBA.
Empathic Computing: Creating Shared Understanding
Mobile App Security Testing_ A Comprehensive Guide.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
20250228 LYD VKU AI Blended-Learning.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Spectroscopy.pptx food analysis technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

Sikuli: Using Screenshots for GUI Automation and Testing