SlideShare a Scribd company logo
Making Visual GUI Testing
Agile
2016-04-28
Geoff Bache
Today’s take home points
• Arrange, Act, Assert: separate problems, different techniques/tools!
• Capture system behaviour, filter it, and manage changes in it
o This is called ”Approval Testing” and comes with tool support!
• Have multiple independent ways of locating GUI widgets available.
o This is called a ”Multilocator”
2
Text Image Position
Visual GUI Testing Fact Sheet
• How it works
o Treats the GUI like a bitmap
o Use the mouse and keyboard to control it
o Makes use of image recognition and text recognition (OCR) techniques
• Examples:
o Open source: Sikuli
o Commercial tools: JAutomate, Eggplant, UFT etc
3
Why Visual GUI Testing?
• Advantages
o Independent of GUI technology
o Can simulate a user very closely
o Easy to get going quickly
• Disadvantages
o Fairly immature and ”bleeding edge”
o Brittle and un-Agile?
4
A favourite Sikuli example: automation or testing?
5
Sikuli’s advice on how to make a test
6
Unit Test Case: Arrange-Act-Assert
7
Arrange Act Assert
x = Number(1);
y = Number(2);
x.add(y); assert x.value() == 3;
Visual GUI Test Case: Arrange-Act-Assert
8
Arrange Act Assert?
Assertions in GUI tests
One assertion per test, now!
assert answerToLifeTheUniverseAndEverything() == 42;
Or, the scattergun approach:
assert textInCell(1, 1) == ”Geoff”;
assert textInCell(3, 4) == ”Sweden”;
assert exists(”OurLogo.png”);
assert not exists(”DancingPony.png”);
...
9
Approval Test Case: Assert = Collate-Filter-Compare
10
Arrange Act
Assert
dump
copy
pdf2text
xmllint
CompareFilterCollate
Behaviour change!
11
Approved Output New Output
TEST FAILURE
Scenario 1: It’s a bug, go fix it!
12
Approved Output Buggy Output
TEST FAILURE
Scenario 2: It’s a feature, press ”Approve”!
13
Old Approved Output New Approved Output
TEST FAILURE
Scenario 2: it’s a feature
14
Old Approved Output New Approved Output
overwrite
Filtering the text
15
dddd-dd-dd{REPLACE <date>}
Tool support for Approval Testing
● Open Source
● Approval Testing
● Data-Driven Testing
● Test Management
● Mature (since 2004) and feature-rich
● I am the author
http://texttest.org
Other tools:
• Approval Tests (Llewellyn Falco): http://approvaltests.sourceforge.net/
• Pearlfish (Nat Pryce): http://github.com/pearlfish/pearlfish-java
16
Approval Testing with Sikuli
17
Arrange
Act
Assert
dump
copy
pdf2text
xmllint
CompareFilterCollate
Text Image Position
”Sikuli is an Automation tool, not a test tool”
• Don’t compare screenshots
o What should the exactness be?
- High -> brittle
- Low -> green tests when it’s broken
• Use Sikuli for the ”Act” part only
o Can use low exactness without fear
• Don’t use the Sikuli IDE
o Normal Python development with normal tools
o Shared image repository
18
Reliability and maintenance issues
• find( )
o Image recognition using OpenCV
o change screen, font, theme? Underscore, shading?
o capturing, administering a lot of images
• find(”Ny beställning”)
o Text recognition using Tesseract (”experimental”)
o White text on dark background, italics, spaces etc
o Finds similar text elsewhere in the GUI
• find(13, 512)
o Pixel position on screen!
o Unreliable. Since 1980s.
19
Multilocators
• Presented by Filippo Ricca (University of Genoa) at ICST 2015
o Web testing using Selenium. Tests were unstable.
o Selenium uses XPaths for finding elements in a web GUI
o 5 algorithms to make an XPath from an element. All may break when GUI changes.
o Use all 5. ”Vote” on where the element can now be found.
o Update the ones that failed based on the ones that succeeded.
o Automatic test maintenance! Not foolproof, but saves time.
20
Multilocators for Visual GUI Testing
• We have 3 visual methods for finding GUI elements
- Text recognition (Tesseract), image recognition (OpenCV) and the pixel position
• All of these are unreliable and hard to maintain if used alone
• If we use them all, they can compensate for each other
o We can update screenshots based on text recognition
o We can do a textual scan of a screenshot to improve our text search
• They can speed each other up
o The position can always be recorded and serves as a hint where to search first
21
Text Image Position
Combined method for finding GUI-objects
• Always start looking for text, if possible
o clickText(”Ny beställning”)
• If this works, build a multilocator automatically
o Generate a screenshot ->
o Store the location in the window -> xhint=2-94 of 1920, yhint=509-528 of 1168
• If it doesn’t work, ask the user to take a screenshot by hand
• Next time, search for the screenshot in the area stored from last time
o Very fast if it works
o Search the whole window again otherwise
• If it fails, we can also
o Try again to find the text, first in the hint area and then the whole window
o Click in the hint area anyway, store the new text and screenshot there, and if the test works, update
everything automatically
• Manual maintenance when objects change appearance and move simultaneously
22
In real life: Evry’s medical referral system
• 120 tests that run every night
o ”Arrange”: Carefully created minimal databases, stored as text files, scripting
o ”Act”: Hierarchically defined ”usecases” in Python, using Sikuli and Multilocators
o ”Assert” : Approval testing with TextTest
- Database dumps, asciified HTML views, internal logs and XML sent to other systems
o Random failure rate about one every other run (~0,5%)
- Timing
- Windows 8’s Metro interface...
23
Text Image Position
How to make Visual GUI Testing Agile
• Arrange, Act, Assert: separate problems, different techniques/tools!
• Capture system behaviour, filter it, and manage changes in it
o This is called ”Approval Testing” and comes with tool support!
• Have multiple independent ways of locating GUI widgets available.
o This is called a ”Multilocator”
24
Text Image Position
25
26

More Related Content

Viewers also liked

Sikuli Test Automation - How to do it?
Sikuli Test Automation - How to do it?Sikuli Test Automation - How to do it?
Sikuli Test Automation - How to do it?
Mykhailo Poliarush
 
Automation Testing with Sikuli
Automation Testing with SikuliAutomation Testing with Sikuli
Automation Testing with Sikulilionpeal
 
L3 gd ha3_the_structureofthegame_050115
L3 gd ha3_the_structureofthegame_050115L3 gd ha3_the_structureofthegame_050115
L3 gd ha3_the_structureofthegame_050115
davidhall1415
 
Diploma and Result Transcript
Diploma and Result TranscriptDiploma and Result Transcript
Diploma and Result TranscriptGenti Sanxhaku
 
부산관광 제주도개인택시
부산관광 제주도개인택시부산관광 제주도개인택시
부산관광 제주도개인택시
hdflkgjdo
 
지루박사이트
지루박사이트지루박사이트
지루박사이트
hdflkgjdo
 
_ ig2 game audio cut sequence production_2014 to 2015
    _ ig2 game audio cut sequence production_2014 to 2015    _ ig2 game audio cut sequence production_2014 to 2015
_ ig2 game audio cut sequence production_2014 to 2015
davidhall1415
 
Final major-project-production-diary-template 2014-2015
Final major-project-production-diary-template 2014-2015Final major-project-production-diary-template 2014-2015
Final major-project-production-diary-template 2014-2015
davidhall1415
 
Final major project production diary template 2014 2015
Final major project production diary template 2014 2015Final major project production diary template 2014 2015
Final major project production diary template 2014 2015
davidhall1415
 
Unit 20 brief 1 task 2_worksheet
Unit 20 brief 1 task 2_worksheetUnit 20 brief 1 task 2_worksheet
Unit 20 brief 1 task 2_worksheet
davidhall1415
 
Miguel de unamuno el modernismo y la generación de ‘98
Miguel de unamuno el modernismo y la generación de ‘98Miguel de unamuno el modernismo y la generación de ‘98
Miguel de unamuno el modernismo y la generación de ‘98
pmclaytor1
 
Romance del rey moro que perdió alhama
Romance del rey moro que perdió alhamaRomance del rey moro que perdió alhama
Romance del rey moro que perdió alhama
pmclaytor1
 
Sikuli
SikuliSikuli
Gouhar el ahogado mas hermoso del mundo
Gouhar el ahogado mas hermoso del mundoGouhar el ahogado mas hermoso del mundo
Gouhar el ahogado mas hermoso del mundo
pmclaytor1
 

Viewers also liked (15)

Sikuli Test Automation - How to do it?
Sikuli Test Automation - How to do it?Sikuli Test Automation - How to do it?
Sikuli Test Automation - How to do it?
 
Automation Testing with Sikuli
Automation Testing with SikuliAutomation Testing with Sikuli
Automation Testing with Sikuli
 
L3 gd ha3_the_structureofthegame_050115
L3 gd ha3_the_structureofthegame_050115L3 gd ha3_the_structureofthegame_050115
L3 gd ha3_the_structureofthegame_050115
 
Diploma and Result Transcript
Diploma and Result TranscriptDiploma and Result Transcript
Diploma and Result Transcript
 
Kamlesh Chandra
Kamlesh ChandraKamlesh Chandra
Kamlesh Chandra
 
부산관광 제주도개인택시
부산관광 제주도개인택시부산관광 제주도개인택시
부산관광 제주도개인택시
 
지루박사이트
지루박사이트지루박사이트
지루박사이트
 
_ ig2 game audio cut sequence production_2014 to 2015
    _ ig2 game audio cut sequence production_2014 to 2015    _ ig2 game audio cut sequence production_2014 to 2015
_ ig2 game audio cut sequence production_2014 to 2015
 
Final major-project-production-diary-template 2014-2015
Final major-project-production-diary-template 2014-2015Final major-project-production-diary-template 2014-2015
Final major-project-production-diary-template 2014-2015
 
Final major project production diary template 2014 2015
Final major project production diary template 2014 2015Final major project production diary template 2014 2015
Final major project production diary template 2014 2015
 
Unit 20 brief 1 task 2_worksheet
Unit 20 brief 1 task 2_worksheetUnit 20 brief 1 task 2_worksheet
Unit 20 brief 1 task 2_worksheet
 
Miguel de unamuno el modernismo y la generación de ‘98
Miguel de unamuno el modernismo y la generación de ‘98Miguel de unamuno el modernismo y la generación de ‘98
Miguel de unamuno el modernismo y la generación de ‘98
 
Romance del rey moro que perdió alhama
Romance del rey moro que perdió alhamaRomance del rey moro que perdió alhama
Romance del rey moro que perdió alhama
 
Sikuli
SikuliSikuli
Sikuli
 
Gouhar el ahogado mas hermoso del mundo
Gouhar el ahogado mas hermoso del mundoGouhar el ahogado mas hermoso del mundo
Gouhar el ahogado mas hermoso del mundo
 

Similar to Making visual gui testing agile

My Linux Job: 21 Linux Pros Tell Us What They Do
My Linux Job: 21 Linux Pros Tell Us What They DoMy Linux Job: 21 Linux Pros Tell Us What They Do
My Linux Job: 21 Linux Pros Tell Us What They Do
Libby Clark
 
Introduction to UI Automation Framework
Introduction to UI Automation FrameworkIntroduction to UI Automation Framework
Introduction to UI Automation Framework
Priya Rajagopal
 
Automated Exploratory Testing
Automated Exploratory TestingAutomated Exploratory Testing
Automated Exploratory Testing
Justin Ison
 
User first! 前端的最後一塊拼圖
User first! 前端的最後一塊拼圖User first! 前端的最後一塊拼圖
User first! 前端的最後一塊拼圖
Maxis Kao
 
Justin Ison
Justin IsonJustin Ison
Justin Ison
CodeFest
 
The GNOME Shell Magnifier: Adding built-in magnification to the GNOME Shell d...
The GNOME Shell Magnifier: Adding built-in magnification to the GNOME Shell d...The GNOME Shell Magnifier: Adding built-in magnification to the GNOME Shell d...
The GNOME Shell Magnifier: Adding built-in magnification to the GNOME Shell d...
AEGIS-ACCESSIBLE Projects
 
Debugging Tips and Tricks - iOS Conf Singapore 2015
Debugging Tips and Tricks - iOS Conf Singapore 2015Debugging Tips and Tricks - iOS Conf Singapore 2015
Debugging Tips and Tricks - iOS Conf Singapore 2015
Fahim Farook
 
Owning windows 8 with human interface devices
Owning windows 8 with human interface devicesOwning windows 8 with human interface devices
Owning windows 8 with human interface devices
Nikhil Mittal
 
The Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with androidThe Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with android
Stanojko Markovik
 
Qtp - Introduction to synchronization
Qtp -  Introduction to synchronizationQtp -  Introduction to synchronization
Qtp - Introduction to synchronization
Vibrant Technologies & Computers
 
Appium Native Application Crawler
Appium Native Application CrawlerAppium Native Application Crawler
Appium Native Application Crawler
Justin Ison
 
What is dev ops?
What is dev ops?What is dev ops?
What is dev ops?
Mukta Aphale
 
Mini Jarvis Final Presentation
Mini Jarvis Final PresentationMini Jarvis Final Presentation
Mini Jarvis Final PresentationYash Sanghavi
 
Testing for the deeplearning folks
Testing for the deeplearning folksTesting for the deeplearning folks
Testing for the deeplearning folks
Vishwas N
 
Enterprise PHP (Zend UK Business Conference)
Enterprise PHP (Zend UK Business Conference)Enterprise PHP (Zend UK Business Conference)
Enterprise PHP (Zend UK Business Conference)
Ivo Jansch
 
Ios - Intorduction to view controller
Ios - Intorduction to view controllerIos - Intorduction to view controller
Ios - Intorduction to view controller
Vibrant Technologies & Computers
 
Devops Devops Devops, at Froscon
Devops Devops Devops, at FrosconDevops Devops Devops, at Froscon
Devops Devops Devops, at Froscon
Kris Buytaert
 
realtimeobject (2).pptx
realtimeobject (2).pptxrealtimeobject (2).pptx
realtimeobject (2).pptx
VijayKumarLokanadam
 
Cross-platform logging and analytics
Cross-platform logging and analyticsCross-platform logging and analytics
Cross-platform logging and analytics
Drew Crawford
 
2012 java one-con3648
2012 java one-con36482012 java one-con3648
2012 java one-con3648Eing Ong
 

Similar to Making visual gui testing agile (20)

My Linux Job: 21 Linux Pros Tell Us What They Do
My Linux Job: 21 Linux Pros Tell Us What They DoMy Linux Job: 21 Linux Pros Tell Us What They Do
My Linux Job: 21 Linux Pros Tell Us What They Do
 
Introduction to UI Automation Framework
Introduction to UI Automation FrameworkIntroduction to UI Automation Framework
Introduction to UI Automation Framework
 
Automated Exploratory Testing
Automated Exploratory TestingAutomated Exploratory Testing
Automated Exploratory Testing
 
User first! 前端的最後一塊拼圖
User first! 前端的最後一塊拼圖User first! 前端的最後一塊拼圖
User first! 前端的最後一塊拼圖
 
Justin Ison
Justin IsonJustin Ison
Justin Ison
 
The GNOME Shell Magnifier: Adding built-in magnification to the GNOME Shell d...
The GNOME Shell Magnifier: Adding built-in magnification to the GNOME Shell d...The GNOME Shell Magnifier: Adding built-in magnification to the GNOME Shell d...
The GNOME Shell Magnifier: Adding built-in magnification to the GNOME Shell d...
 
Debugging Tips and Tricks - iOS Conf Singapore 2015
Debugging Tips and Tricks - iOS Conf Singapore 2015Debugging Tips and Tricks - iOS Conf Singapore 2015
Debugging Tips and Tricks - iOS Conf Singapore 2015
 
Owning windows 8 with human interface devices
Owning windows 8 with human interface devicesOwning windows 8 with human interface devices
Owning windows 8 with human interface devices
 
The Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with androidThe Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with android
 
Qtp - Introduction to synchronization
Qtp -  Introduction to synchronizationQtp -  Introduction to synchronization
Qtp - Introduction to synchronization
 
Appium Native Application Crawler
Appium Native Application CrawlerAppium Native Application Crawler
Appium Native Application Crawler
 
What is dev ops?
What is dev ops?What is dev ops?
What is dev ops?
 
Mini Jarvis Final Presentation
Mini Jarvis Final PresentationMini Jarvis Final Presentation
Mini Jarvis Final Presentation
 
Testing for the deeplearning folks
Testing for the deeplearning folksTesting for the deeplearning folks
Testing for the deeplearning folks
 
Enterprise PHP (Zend UK Business Conference)
Enterprise PHP (Zend UK Business Conference)Enterprise PHP (Zend UK Business Conference)
Enterprise PHP (Zend UK Business Conference)
 
Ios - Intorduction to view controller
Ios - Intorduction to view controllerIos - Intorduction to view controller
Ios - Intorduction to view controller
 
Devops Devops Devops, at Froscon
Devops Devops Devops, at FrosconDevops Devops Devops, at Froscon
Devops Devops Devops, at Froscon
 
realtimeobject (2).pptx
realtimeobject (2).pptxrealtimeobject (2).pptx
realtimeobject (2).pptx
 
Cross-platform logging and analytics
Cross-platform logging and analyticsCross-platform logging and analytics
Cross-platform logging and analytics
 
2012 java one-con3648
2012 java one-con36482012 java one-con3648
2012 java one-con3648
 

Recently uploaded

Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
Roshan Dwivedi
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
Google
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 

Recently uploaded (20)

Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 

Making visual gui testing agile

  • 1. Making Visual GUI Testing Agile 2016-04-28 Geoff Bache
  • 2. Today’s take home points • Arrange, Act, Assert: separate problems, different techniques/tools! • Capture system behaviour, filter it, and manage changes in it o This is called ”Approval Testing” and comes with tool support! • Have multiple independent ways of locating GUI widgets available. o This is called a ”Multilocator” 2 Text Image Position
  • 3. Visual GUI Testing Fact Sheet • How it works o Treats the GUI like a bitmap o Use the mouse and keyboard to control it o Makes use of image recognition and text recognition (OCR) techniques • Examples: o Open source: Sikuli o Commercial tools: JAutomate, Eggplant, UFT etc 3
  • 4. Why Visual GUI Testing? • Advantages o Independent of GUI technology o Can simulate a user very closely o Easy to get going quickly • Disadvantages o Fairly immature and ”bleeding edge” o Brittle and un-Agile? 4
  • 5. A favourite Sikuli example: automation or testing? 5
  • 6. Sikuli’s advice on how to make a test 6
  • 7. Unit Test Case: Arrange-Act-Assert 7 Arrange Act Assert x = Number(1); y = Number(2); x.add(y); assert x.value() == 3;
  • 8. Visual GUI Test Case: Arrange-Act-Assert 8 Arrange Act Assert?
  • 9. Assertions in GUI tests One assertion per test, now! assert answerToLifeTheUniverseAndEverything() == 42; Or, the scattergun approach: assert textInCell(1, 1) == ”Geoff”; assert textInCell(3, 4) == ”Sweden”; assert exists(”OurLogo.png”); assert not exists(”DancingPony.png”); ... 9
  • 10. Approval Test Case: Assert = Collate-Filter-Compare 10 Arrange Act Assert dump copy pdf2text xmllint CompareFilterCollate
  • 11. Behaviour change! 11 Approved Output New Output TEST FAILURE
  • 12. Scenario 1: It’s a bug, go fix it! 12 Approved Output Buggy Output TEST FAILURE
  • 13. Scenario 2: It’s a feature, press ”Approve”! 13 Old Approved Output New Approved Output TEST FAILURE
  • 14. Scenario 2: it’s a feature 14 Old Approved Output New Approved Output overwrite
  • 16. Tool support for Approval Testing ● Open Source ● Approval Testing ● Data-Driven Testing ● Test Management ● Mature (since 2004) and feature-rich ● I am the author http://texttest.org Other tools: • Approval Tests (Llewellyn Falco): http://approvaltests.sourceforge.net/ • Pearlfish (Nat Pryce): http://github.com/pearlfish/pearlfish-java 16
  • 17. Approval Testing with Sikuli 17 Arrange Act Assert dump copy pdf2text xmllint CompareFilterCollate Text Image Position
  • 18. ”Sikuli is an Automation tool, not a test tool” • Don’t compare screenshots o What should the exactness be? - High -> brittle - Low -> green tests when it’s broken • Use Sikuli for the ”Act” part only o Can use low exactness without fear • Don’t use the Sikuli IDE o Normal Python development with normal tools o Shared image repository 18
  • 19. Reliability and maintenance issues • find( ) o Image recognition using OpenCV o change screen, font, theme? Underscore, shading? o capturing, administering a lot of images • find(”Ny beställning”) o Text recognition using Tesseract (”experimental”) o White text on dark background, italics, spaces etc o Finds similar text elsewhere in the GUI • find(13, 512) o Pixel position on screen! o Unreliable. Since 1980s. 19
  • 20. Multilocators • Presented by Filippo Ricca (University of Genoa) at ICST 2015 o Web testing using Selenium. Tests were unstable. o Selenium uses XPaths for finding elements in a web GUI o 5 algorithms to make an XPath from an element. All may break when GUI changes. o Use all 5. ”Vote” on where the element can now be found. o Update the ones that failed based on the ones that succeeded. o Automatic test maintenance! Not foolproof, but saves time. 20
  • 21. Multilocators for Visual GUI Testing • We have 3 visual methods for finding GUI elements - Text recognition (Tesseract), image recognition (OpenCV) and the pixel position • All of these are unreliable and hard to maintain if used alone • If we use them all, they can compensate for each other o We can update screenshots based on text recognition o We can do a textual scan of a screenshot to improve our text search • They can speed each other up o The position can always be recorded and serves as a hint where to search first 21 Text Image Position
  • 22. Combined method for finding GUI-objects • Always start looking for text, if possible o clickText(”Ny beställning”) • If this works, build a multilocator automatically o Generate a screenshot -> o Store the location in the window -> xhint=2-94 of 1920, yhint=509-528 of 1168 • If it doesn’t work, ask the user to take a screenshot by hand • Next time, search for the screenshot in the area stored from last time o Very fast if it works o Search the whole window again otherwise • If it fails, we can also o Try again to find the text, first in the hint area and then the whole window o Click in the hint area anyway, store the new text and screenshot there, and if the test works, update everything automatically • Manual maintenance when objects change appearance and move simultaneously 22
  • 23. In real life: Evry’s medical referral system • 120 tests that run every night o ”Arrange”: Carefully created minimal databases, stored as text files, scripting o ”Act”: Hierarchically defined ”usecases” in Python, using Sikuli and Multilocators o ”Assert” : Approval testing with TextTest - Database dumps, asciified HTML views, internal logs and XML sent to other systems o Random failure rate about one every other run (~0,5%) - Timing - Windows 8’s Metro interface... 23 Text Image Position
  • 24. How to make Visual GUI Testing Agile • Arrange, Act, Assert: separate problems, different techniques/tools! • Capture system behaviour, filter it, and manage changes in it o This is called ”Approval Testing” and comes with tool support! • Have multiple independent ways of locating GUI widgets available. o This is called a ”Multilocator” 24 Text Image Position
  • 25. 25
  • 26. 26