SlideShare ist ein Scribd-Unternehmen logo
1 von 54
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Andere mochten auch

Exploring the internal state of user interfaces using sikuli
Exploring the internal state of user interfaces using sikuliExploring the internal state of user interfaces using sikuli
Exploring the internal state of user interfaces using sikuli
Germiya K Jose
 
Connected Prisons_Catalysts For Change Zone of Future Innovtion
Connected Prisons_Catalysts For Change Zone of Future InnovtionConnected Prisons_Catalysts For Change Zone of Future Innovtion
Connected Prisons_Catalysts For Change Zone of Future Innovtion
Institute for the Future
 
Diapositivas tegno
Diapositivas tegnoDiapositivas tegno
Diapositivas tegno
anyiflak
 
Samenleving 2013 100610
Samenleving 2013 100610Samenleving 2013 100610
Samenleving 2013 100610
Cees Corstanje
 
Gross Printed Product_Catalysts For Change Zone of Future Innovtion
Gross Printed Product_Catalysts For Change Zone of Future InnovtionGross Printed Product_Catalysts For Change Zone of Future Innovtion
Gross Printed Product_Catalysts For Change Zone of Future Innovtion
Institute for the Future
 
Hyper Urban Farming_Catalysts For Change Zone of Future Innovtion
Hyper Urban Farming_Catalysts For Change Zone of Future InnovtionHyper Urban Farming_Catalysts For Change Zone of Future Innovtion
Hyper Urban Farming_Catalysts For Change Zone of Future Innovtion
Institute for the Future
 
Digtal media task guide
Digtal media task  guideDigtal media task  guide
Digtal media task guide
greg robertson
 
mundial sudafrica_2010
mundial sudafrica_2010mundial sudafrica_2010
mundial sudafrica_2010
carloscrespo1
 
There &amp; Back Again
There &amp; Back AgainThere &amp; Back Again
There &amp; Back Again
rhaffner
 

Andere mochten auch (20)

Exploring the internal state of user interfaces using sikuli
Exploring the internal state of user interfaces using sikuliExploring the internal state of user interfaces using sikuli
Exploring the internal state of user interfaces using sikuli
 
Sikuli
SikuliSikuli
Sikuli
 
Sikuli script
Sikuli scriptSikuli script
Sikuli script
 
Osc tokyo2010 fall_zfs
Osc tokyo2010 fall_zfsOsc tokyo2010 fall_zfs
Osc tokyo2010 fall_zfs
 
Connected Prisons_Catalysts For Change Zone of Future Innovtion
Connected Prisons_Catalysts For Change Zone of Future InnovtionConnected Prisons_Catalysts For Change Zone of Future Innovtion
Connected Prisons_Catalysts For Change Zone of Future Innovtion
 
Diapositivas tegno
Diapositivas tegnoDiapositivas tegno
Diapositivas tegno
 
Samenleving 2013 100610
Samenleving 2013 100610Samenleving 2013 100610
Samenleving 2013 100610
 
Innomantra innovation & intellectual property - 2015 f9
Innomantra   innovation & intellectual property - 2015 f9Innomantra   innovation & intellectual property - 2015 f9
Innomantra innovation & intellectual property - 2015 f9
 
Gross Printed Product_Catalysts For Change Zone of Future Innovtion
Gross Printed Product_Catalysts For Change Zone of Future InnovtionGross Printed Product_Catalysts For Change Zone of Future Innovtion
Gross Printed Product_Catalysts For Change Zone of Future Innovtion
 
Hyper Urban Farming_Catalysts For Change Zone of Future Innovtion
Hyper Urban Farming_Catalysts For Change Zone of Future InnovtionHyper Urban Farming_Catalysts For Change Zone of Future Innovtion
Hyper Urban Farming_Catalysts For Change Zone of Future Innovtion
 
Innomantra - Intellectual Property Consulting & Services
Innomantra - Intellectual Property Consulting & ServicesInnomantra - Intellectual Property Consulting & Services
Innomantra - Intellectual Property Consulting & Services
 
EzMate 401 Arise Biotech
EzMate 401 Arise BiotechEzMate 401 Arise Biotech
EzMate 401 Arise Biotech
 
As caras do entroido ourensan
As caras do entroido ourensanAs caras do entroido ourensan
As caras do entroido ourensan
 
Digtal media task guide
Digtal media task  guideDigtal media task  guide
Digtal media task guide
 
mundial sudafrica_2010
mundial sudafrica_2010mundial sudafrica_2010
mundial sudafrica_2010
 
Metrar group protocolo de iluminacion -----2015
Metrar group   protocolo de iluminacion -----2015Metrar group   protocolo de iluminacion -----2015
Metrar group protocolo de iluminacion -----2015
 
There &amp; Back Again
There &amp; Back AgainThere &amp; Back Again
There &amp; Back Again
 
Aula android 04
Aula android 04Aula android 04
Aula android 04
 
A&m assessment help
A&m assessment helpA&m assessment help
A&m assessment help
 
Tratado practico de fotografia industrial
Tratado practico de fotografia industrialTratado practico de fotografia industrial
Tratado practico de fotografia industrial
 

Ähnlich wie Sikuli: Using Screenshots for GUI Automation and Testing

2011 py con
2011 py con2011 py con
2011 py con
Eing Ong
 
2010 bb dev con
2010 bb dev con 2010 bb dev con
2010 bb dev con
Eing Ong
 
[CB16] About the cyber grand challenge: the world’s first all-machine hacking...
[CB16] About the cyber grand challenge: the world’s first all-machine hacking...[CB16] About the cyber grand challenge: the world’s first all-machine hacking...
[CB16] About the cyber grand challenge: the world’s first all-machine hacking...
CODE BLUE
 

Ähnlich wie Sikuli: Using Screenshots for GUI Automation and Testing (20)

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

Kürzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Kürzlich hochgeladen (20)

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Sikuli: Using Screenshots for GUI Automation and Testing