SlideShare a Scribd company logo
1 of 72
COLORFUL WORLD
of
VISUAL TEST AUTOMATION
Onur Başkırt
Who am I?
▪ I am Onur Başkırt
▪ Head of Software Testing at
▪ Co-owner of
▪ Formerly: Teknosa, Ericsson, Huawei, STMicroelectronics, BAU & USCS
Online Employment and Recruitment Market Leader
in TURKEY since 1999
5.6 million
Visitors
180 million
Page views
25 million
Resumes
75.000+
Employers
Technical Software Testing Blog
Automation Performance Security DevOps
Outline
• What is Visual Test Automation?
• Why Visual Testing?
• Why Automation?
• Challenges
• Visual Test Automation Tools
• Brief Overviews
• Detailed Reviews (Applitools Eyes, Percy.io, Galen Framework)
• Selenium & ImageMagick & AShot Example
• Q&A
What is Visual Test Automation?
• Verifies the GUI is displayed as expected to the end users.
• Focuses on visual contents:
• Colors
• Shapes
• Sizes
• Locations of elements
UI Test vs Visual Test
Why do We do Visual Testing?
WordPress
Template
CSS
animations
Widgets Sliders etc.
Mobile App
Generation
Engine
.ipa
.apk
GUI MUST APPEAR CORRECTLY
USER INTEARCTIONS
COMPANY BRAND
CRITICAL PRODUCTS and SERVICES
Why do We Automate Visual Testing?
Variety of Test Environments
• Browsers – Mobile Devices – Resolutions etc.
Time to Market Pressure
• Release cycles getting shorter.
Manual Visual Testing is Cumbersome
• Human eyes error-prone and getting blind.
In Mobile World, you will live with visual bugs longer
• Can not update mobile app daily.
What are the Challenges?
• Anti-aliasing
What are the Challenges?
• Dynamic Content (CSS Animations, GIFs)
What are the Challenges?
Dynamic content
Dynamic Content
Auto-Kerning Offsets
BRIEF OVERVIEW of
Well-Known
VISUAL AUTOMATION TOOLS
PhantomCSS (Open-Source by Huddle, 4197+ Stars on GitHub)
• PhantomJS (Webkit) and SlimerJS (Gecko)Browsers
• CasperJSNavigation
• ResembleJSComparison
• Ignores Colors, Antialiasing, Moving
Elements
Features
WebdriverCSS (Open-Source, 447+ Stars on GitHub)
• Chrome, Firefox, PhantomJSBrowsers
• WebdriverIO v2.0
Selenium Bindings for NodeJS
Navigation
• GraphicsMagickComparison
• Ignores Color, AntialiasingFeatures
Wraith (Open-Source by BBC, 3883+ Stars on GitHub)
• PhantomJS, SlimerJSBrowsers
• Configuration Based .yaml file
• CasperJS
Navigation
• ImageMagickComparison
• Fuzz Option
• Antialiasing and small changes
Features
• and many tools exists in the market both open-source and commercial.
• FBSnapshotTestCase
• Needle
• Rspec Page Regression
• Pix-Diff
• Selenium Visual Diff
• Vizregress
• VisualCeption
• Specter
• Fighting Layout Bugs
• dpdxt
• Huxley
• SiteEffect
• Shoov
• Screener.io
• BaskstopJS
• CSSCritic
• Grunt Photobox
• VIFF
• GreenOnion
• Kobold
• CSS Visual TestAsd
• Snap And Compare
• Grunt-Vigo
• Hardy
• Browsershots
• Screenbeacon
• VisualReview
• Gemini
APPLITOOLS EYES
What is Applitools Eyes?
• Automated Visual Testing Tool for Web sites and Mobile apps
• Finds Visual Differences with Several Match Levels
• Eyes SDK for Selenium & Appium
• Cloud-Based Clean and Informative Dashboard
How Does it Work?
Visually notifies the differences
At 2nd run and more it compares actual screenshots with the baselines.
At 1st run it saves all screenshots as baseline
Takes screenshots with Eyes SDK and sends to the Applitools cloud
Match Levels and Their Meanings?
• Pixel by Pixel ComparisonEXACT
• Mimics the human eyes.
• Ignores trivial mismatches (antialiasing, small pixel movements, etc.)
STRICT
• Similar with STRICT plus it ignores color changes.CONTENT
• Compares the layouts.
• Checks the elements locations.
LAYOUT
4 Main Steps of Eyes SDK
Close the Test
eyes.close();
Add UI validation Check Points
eyes.checkWindow("Validation Window Name");
Start a Test
eyes.open(driver, APP_NAME, TEST_NAME);
Create and Configure an Eyes Object
Eyes eyes = new Eyes();
Mobile Visual Testing Example
Open BitbarSampleApp.apk
* Visually check that start screen as expected?
Click second option “Use Testdroid Cloud”
*Visually check that Second Option is clicked?
Write “SW Test Academy” to text bar
Click Answer button
Wait until the second page appear
*Visually check that the answer is correct?
Close the driver.
Mobile Visual Testing Example
Step-1: Install Eyes SDK with Maven Dependency
<dependency>
<groupId>com.applitools</groupId>
<artifactId>eyes-selenium-java</artifactId>
<version>RELEASE</version>
</dependency>
Step-2: Do Appium, Android SDK and GenyMotion Settings
Mobile Visual Testing Example
Step-3: Configure Eyes SDK in your Setup Method
Mobile Visual Testing Example
Step-4: Open Eyes  Do Visual Check  Close Eyes
Open Eyes!
Perform a Visual Check!
Close Eyes!
Abort if Eyes not closed!
Mobile Visual Testing Example
Step-5: Run and Check Results – First RUN (BASELINES)
Mobile Visual Testing Example
Step-5: Run and Check Results – PASSED RESULTS
Mobile Visual Testing Example
Step-5: Run and Check Results – FAILED RESULTS
Applitools Settings
GALEN FRAMEWORK
What is Galen Framework?
Automated LAYOUT and RESPONSIVE testing framework.
• Runs in Selenium Grid (SauceLabs & BrowserStack)
• Supports Parallel Testing
Programming Languages
• Basic Syntax
• JavaScript
• JAVA & Selenium Webdriver & TestNG/Junit 
Galen Reporting
• Error Reporting
Generates HTML reports where you can see
all your test objects
• Screenshots
Highlights the misaligned elements
• Image Comparison
Compares images and shows differences
Galen Example with JAVA & Webdriver & TestNG
Logo: 31 pixel
below from the
header
Header: 0px to
the right, left, top
Navigation Links:
Horizontally aligned.
Logo should displayed
correctly.
Galen Example with JAVA & Webdriver & TestNG
Step-1: Installation with Maven Dependency
<dependency>
<groupId>com.galenframework</groupId>
<artifactId>galen-java-support</artifactId>
<version>2.3.2</version>
</dependency>
Galen Example with JAVA & Webdriver & TestNG
Step-2: Write a Galen Specifications (.gspec)
web elementsfor desktop
Declaring locations
tagging
Image Comparison
loops
5
Galen Example with JAVA & Webdriver & TestNG
Step-3: Write your Test Code
Get Layout Report
Get Galen Test
Information from
Layout Report
Generate HTML Report based on
Galen Test Information
Galen Example with JAVA & Webdriver & TestNG
Step-4: Folder Structure
Galen Example with JAVA & Webdriver & TestNG
Step-5: Run the Test and Check The Results
Galen Test Report
Galen Example with JAVA & Webdriver & TestNG
Homepage Layout Report
Galen Example with JAVA & Webdriver & TestNG
LAYOUT ERRORS
Galen Example with JAVA & Webdriver & TestNG
HEATMAP
Galen Example with JAVA & Webdriver & TestNG
IMAGE COMPARISON ERRORS
What is Percy?
Visual regression testing and review platform.
• COMPARES images, FINDS differences.
• We can REVIEW and APPROVE changes.
• Supports RESPONSIVE Design testing.
• Prevents FALSE-POSITIVES.
• PARALLEL TESTING support.
• Integrated with GitHub and many CI tools.
Which Technologies Does it Support?
CI Tool Integrations Languages/Clients
Travis CI Ember
CircleCI Ruby – Capybara
Semaphore Python – Selenium (BETA)
Codeship Static websites
Buildkite
Drone
Jenkins
How Does it Work?
When commit any code changes.
Installation Ember Percy
Requirements for Ember Percy with Jenkins and GitHub
git node.js ember.js
ember-
percy
Phantom.js bower Jenkins GitHub
Percy Installation Steps (Percy Side)
• Go to Percy.io and click Sign In WITH GITHUB.
• Go to Percy Dashboard and Create an Organization
• Install GitHub Integration
• Create a project and get your CI integration variables:
PERCY_TOKEN & PERCY_PROJECT
Percy Installation Steps (Jenkins Side)
• Set your PERCY_TOKEN and PERCY_PROJECT environment variables
• Do GitHub Integration settings and Create a Jenkins Job.
• Do your Ember Project’s Repository settings.
• Add build and test Windows Batch commands:
• For BUILD:
• For TEST:
npm install && bower install
npm test
How to Write Test with Ember-Percy?
percySnapshot(name, options);
scope  For element to snapshots. Default is full page.
percySnapshot('homepage', {scope: '#header'});
Takes ScreenShots
Sample Test Code Official TODO Example of Percy
Navigate the homepage
Take ScreenShot
Write sth to the bar
and
Press Enter Assertions
Take Final ScreenShot
Responsive Design Test Code
Define Resolutions
by Screen Widths
First Run  No Comparison (BASELINES)
Second Run  PASSED!
Third Run  FAILED!
Visual Test Automation by Using
ImageMagick & Selenium & AShot
What is ImageMagick?
• Open-source software suite that manipulates
images in a variety of formats (over 200) including
PNG, JPEG, GIF, etc.
• Edits, Converts, Resizes, Compares, Rotates,
Adjusts Colors etc.
• For JAVA it has Im4java which is a pure-java
interface.
What is AShot?
• Yandex's screenshot utility which takes, crops, prettifies and
compares screenshots.
• Entire Page
• Web Element
Example Test Scenario (Basic CSS Animation Check)
• Open www.kariyer.net
• Unhide text area of Uzman Photo
• Hover on the “UZMAN” weblement on main page.
• Wait 2 seconds to finish CSS animation
• Take screenshot of an element and save as Baseline
for the 1st Run.
• For 2nd and more runs COMPARE baseline image
with actual image.
• Put all differences in "Differences folder"
HOVER
BASELINE
Example Test Scenario (Basic CSS Animation Check)
• Step-1: Install ImageMagick with all options and add to system path.
Example Test Scenario (Basic CSS Animation Check)
• Step-2: Create a Selenium & TestNG project and add dependencies
Example Test Scenario (Basic CSS Animation Check)
Test Method’s Code
AShot
ImageMagick
JavascriptExecutor
Example Test Scenario (Basic CSS Animation Check)
How to Take Screenshot with AShot
Example Test Scenario (Basic CSS Animation Check)
If Baseline Exists, Do Comparison!
ImageMagick Comparison
ImageMagick
Configurations
Add images to ImageMagick
Operation object for comparison
Do Comparison!
First Run
Test ScreenShot Folder is created
by using Test Name
Second Run
Change The Baseline
Test Folder
Third Run!
Arithmetic Error
Number
DifferencesFolder
TestFolder
TestFailed!
THANKS  QUESTIONS?
onurb@kariyer.net
@swtestacademy
@onurbaskirt

More Related Content

What's hot

Implementando Testes Unitários em Java - Manoel Pimentel
Implementando Testes Unitários em Java - Manoel PimentelImplementando Testes Unitários em Java - Manoel Pimentel
Implementando Testes Unitários em Java - Manoel Pimentel
Manoel Pimentel Medeiros
 
Unit testing best practices
Unit testing best practicesUnit testing best practices
Unit testing best practices
nickokiss
 

What's hot (20)

Cilium + Istio with Gloo Mesh
Cilium + Istio with Gloo MeshCilium + Istio with Gloo Mesh
Cilium + Istio with Gloo Mesh
 
C++ Unit Test with Google Testing Framework
C++ Unit Test with Google Testing FrameworkC++ Unit Test with Google Testing Framework
C++ Unit Test with Google Testing Framework
 
Robot framework 을 이용한 기능 테스트 자동화
Robot framework 을 이용한 기능 테스트 자동화Robot framework 을 이용한 기능 테스트 자동화
Robot framework 을 이용한 기능 테스트 자동화
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Implementando Testes Unitários em Java - Manoel Pimentel
Implementando Testes Unitários em Java - Manoel PimentelImplementando Testes Unitários em Java - Manoel Pimentel
Implementando Testes Unitários em Java - Manoel Pimentel
 
Ansible - Hands on Training
Ansible - Hands on TrainingAnsible - Hands on Training
Ansible - Hands on Training
 
Unit testing best practices
Unit testing best practicesUnit testing best practices
Unit testing best practices
 
Extending Java EE with CDI and JBoss Forge
Extending Java EE with CDI and JBoss ForgeExtending Java EE with CDI and JBoss Forge
Extending Java EE with CDI and JBoss Forge
 
Hands On Introduction To Ansible Configuration Management With Ansible Comple...
Hands On Introduction To Ansible Configuration Management With Ansible Comple...Hands On Introduction To Ansible Configuration Management With Ansible Comple...
Hands On Introduction To Ansible Configuration Management With Ansible Comple...
 
Linux interview questions and answers
Linux interview questions and answersLinux interview questions and answers
Linux interview questions and answers
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Kamailio with Docker and Kubernetes
Kamailio with Docker and KubernetesKamailio with Docker and Kubernetes
Kamailio with Docker and Kubernetes
 
Scale Kubernetes to support 50000 services
Scale Kubernetes to support 50000 servicesScale Kubernetes to support 50000 services
Scale Kubernetes to support 50000 services
 
Java básico - Módulo 05 - Estruturas de Repetição
Java  básico - Módulo 05 - Estruturas de RepetiçãoJava  básico - Módulo 05 - Estruturas de Repetição
Java básico - Módulo 05 - Estruturas de Repetição
 
Ansible Automation Platform.pdf
Ansible Automation Platform.pdfAnsible Automation Platform.pdf
Ansible Automation Platform.pdf
 
Unit Testing in Java
Unit Testing in JavaUnit Testing in Java
Unit Testing in Java
 
Git101
Git101Git101
Git101
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with Ansible
 
Microservices Network Architecture 101
Microservices Network Architecture 101Microservices Network Architecture 101
Microservices Network Architecture 101
 
Cypress-vs-Playwright-Rematch-Applitools.pdf
Cypress-vs-Playwright-Rematch-Applitools.pdfCypress-vs-Playwright-Rematch-Applitools.pdf
Cypress-vs-Playwright-Rematch-Applitools.pdf
 

Viewers also liked

Excuse me, sir, do you have a moment to talk about tests in Kotlin
Excuse me, sir, do you have a moment to talk about tests in KotlinExcuse me, sir, do you have a moment to talk about tests in Kotlin
Excuse me, sir, do you have a moment to talk about tests in Kotlin
leonsabr
 

Viewers also liked (20)

Test trend analysis: Towards robust reliable and timely tests
Test trend analysis: Towards robust reliable and timely testsTest trend analysis: Towards robust reliable and timely tests
Test trend analysis: Towards robust reliable and timely tests
 
Grading the Quality of Selenium Tests
Grading the Quality of Selenium TestsGrading the Quality of Selenium Tests
Grading the Quality of Selenium Tests
 
Design patterns in test automation
Design patterns in test automationDesign patterns in test automation
Design patterns in test automation
 
Protractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applicationsProtractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applications
 
Testing Metrics - Making your tests visible
Testing Metrics - Making your tests visibleTesting Metrics - Making your tests visible
Testing Metrics - Making your tests visible
 
End-to-End Test Automation for Both Horizontal and Vertical Scale
End-to-End Test Automation for Both Horizontal and Vertical ScaleEnd-to-End Test Automation for Both Horizontal and Vertical Scale
End-to-End Test Automation for Both Horizontal and Vertical Scale
 
Тестирование производительности клиентсайда
Тестирование производительности клиентсайдаТестирование производительности клиентсайда
Тестирование производительности клиентсайда
 
SoapUI one key to all doors
SoapUI one key to all doorsSoapUI one key to all doors
SoapUI one key to all doors
 
How does Java 8 exert hidden power on Test Automation?
How does Java 8 exert hidden power on Test Automation?How does Java 8 exert hidden power on Test Automation?
How does Java 8 exert hidden power on Test Automation?
 
WixAutomation - Test State Pattern - Selenium Camp 2017
WixAutomation - Test State Pattern - Selenium Camp 2017WixAutomation - Test State Pattern - Selenium Camp 2017
WixAutomation - Test State Pattern - Selenium Camp 2017
 
iOS Parallel Automation: run faster than fast — Viktar Karanevich — SeleniumC...
iOS Parallel Automation: run faster than fast — Viktar Karanevich — SeleniumC...iOS Parallel Automation: run faster than fast — Viktar Karanevich — SeleniumC...
iOS Parallel Automation: run faster than fast — Viktar Karanevich — SeleniumC...
 
Test Automation Architecture in Microservices
Test Automation Architecture in MicroservicesTest Automation Architecture in Microservices
Test Automation Architecture in Microservices
 
An easy way to automate complex UI
An easy way to automate complex UIAn easy way to automate complex UI
An easy way to automate complex UI
 
Fabulous Tests on Spock and Groovy
Fabulous Tests on Spock and GroovyFabulous Tests on Spock and Groovy
Fabulous Tests on Spock and Groovy
 
Better Bullshit Driven Development [SeleniumCamp 2017]
Better Bullshit Driven Development [SeleniumCamp 2017]Better Bullshit Driven Development [SeleniumCamp 2017]
Better Bullshit Driven Development [SeleniumCamp 2017]
 
5 top pain points of test automation
5 top pain points of test automation5 top pain points of test automation
5 top pain points of test automation
 
Excuse me, sir, do you have a moment to talk about tests in Kotlin
Excuse me, sir, do you have a moment to talk about tests in KotlinExcuse me, sir, do you have a moment to talk about tests in Kotlin
Excuse me, sir, do you have a moment to talk about tests in Kotlin
 
Selenium Overview - By Adam Carmi
Selenium Overview - By Adam CarmiSelenium Overview - By Adam Carmi
Selenium Overview - By Adam Carmi
 
XpDays - Automated testing of responsive design (GalenFramework)
XpDays - Automated testing of responsive design (GalenFramework)XpDays - Automated testing of responsive design (GalenFramework)
XpDays - Automated testing of responsive design (GalenFramework)
 
Get responsive with Galen
Get responsive with GalenGet responsive with Galen
Get responsive with Galen
 

Similar to Colorful world-of-visual-automation-testing-latest

Visual Testing: Quality and Speed -- by GIl Tayar, Applitools
Visual Testing: Quality and Speed -- by GIl Tayar, Applitools Visual Testing: Quality and Speed -- by GIl Tayar, Applitools
Visual Testing: Quality and Speed -- by GIl Tayar, Applitools
Applitools
 

Similar to Colorful world-of-visual-automation-testing-latest (20)

Introduction to automated visual testing
Introduction to automated visual testingIntroduction to automated visual testing
Introduction to automated visual testing
 
Adam carmi
Adam carmiAdam carmi
Adam carmi
 
Advanced automated visual testing with Selenium
Advanced automated visual testing with SeleniumAdvanced automated visual testing with Selenium
Advanced automated visual testing with Selenium
 
Visual regression with applitools eyes
Visual regression with applitools eyesVisual regression with applitools eyes
Visual regression with applitools eyes
 
Visual Testing: Quality and Speed -- by GIl Tayar, Applitools
Visual Testing: Quality and Speed -- by GIl Tayar, Applitools Visual Testing: Quality and Speed -- by GIl Tayar, Applitools
Visual Testing: Quality and Speed -- by GIl Tayar, Applitools
 
Advanced Automated Visual Testing
Advanced Automated Visual TestingAdvanced Automated Visual Testing
Advanced Automated Visual Testing
 
Growing Trends of Open Source UI Frameworks
Growing Trends of Open Source UI FrameworksGrowing Trends of Open Source UI Frameworks
Growing Trends of Open Source UI Frameworks
 
SeConf2015: Advanced Automated Visual Testing With Selenium
SeConf2015: Advanced Automated Visual Testing With SeleniumSeConf2015: Advanced Automated Visual Testing With Selenium
SeConf2015: Advanced Automated Visual Testing With Selenium
 
Visual Automation Framework via Screenshot Comparison
Visual Automation Framework via Screenshot ComparisonVisual Automation Framework via Screenshot Comparison
Visual Automation Framework via Screenshot Comparison
 
Appium Interview Questions and Answers | Edureka
Appium Interview Questions and Answers | EdurekaAppium Interview Questions and Answers | Edureka
Appium Interview Questions and Answers | Edureka
 
Web Test Automation Framework - IndicThreads Conference
Web Test Automation Framework  - IndicThreads ConferenceWeb Test Automation Framework  - IndicThreads Conference
Web Test Automation Framework - IndicThreads Conference
 
Advanced Visual Test Automation with Selenium
Advanced Visual Test Automation with SeleniumAdvanced Visual Test Automation with Selenium
Advanced Visual Test Automation with Selenium
 
Microsoft DevOps Solution - DevOps
Microsoft DevOps Solution - DevOps  Microsoft DevOps Solution - DevOps
Microsoft DevOps Solution - DevOps
 
Automated Visual Testing That Does Not Suck
Automated Visual Testing That Does Not SuckAutomated Visual Testing That Does Not Suck
Automated Visual Testing That Does Not Suck
 
Automated Visual Testing That Doesn't Suck!
Automated Visual Testing That Doesn't Suck!Automated Visual Testing That Doesn't Suck!
Automated Visual Testing That Doesn't Suck!
 
[webinar] Cutting-edge Functional UI Testing Techniques - w/ Adam Carmi
[webinar] Cutting-edge Functional UI Testing Techniques - w/ Adam Carmi[webinar] Cutting-edge Functional UI Testing Techniques - w/ Adam Carmi
[webinar] Cutting-edge Functional UI Testing Techniques - w/ Adam Carmi
 
Udvid din test portefølje med coded ui test og cloud load test
Udvid din test portefølje med coded ui test og cloud load testUdvid din test portefølje med coded ui test og cloud load test
Udvid din test portefølje med coded ui test og cloud load test
 
Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by Example
 
Selenium Based Visual Test Automation
Selenium Based Visual Test AutomationSelenium Based Visual Test Automation
Selenium Based Visual Test Automation
 
Sauce Labs+Applitools - Automated Visual Testing in the Cloud
Sauce Labs+Applitools - Automated Visual Testing in the CloudSauce Labs+Applitools - Automated Visual Testing in the Cloud
Sauce Labs+Applitools - Automated Visual Testing in the Cloud
 

Recently uploaded

Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Recently uploaded (20)

WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 

Colorful world-of-visual-automation-testing-latest

  • 1.
  • 2. COLORFUL WORLD of VISUAL TEST AUTOMATION Onur Başkırt
  • 3. Who am I? ▪ I am Onur Başkırt ▪ Head of Software Testing at ▪ Co-owner of ▪ Formerly: Teknosa, Ericsson, Huawei, STMicroelectronics, BAU & USCS
  • 4. Online Employment and Recruitment Market Leader in TURKEY since 1999 5.6 million Visitors 180 million Page views 25 million Resumes 75.000+ Employers
  • 5. Technical Software Testing Blog Automation Performance Security DevOps
  • 6. Outline • What is Visual Test Automation? • Why Visual Testing? • Why Automation? • Challenges • Visual Test Automation Tools • Brief Overviews • Detailed Reviews (Applitools Eyes, Percy.io, Galen Framework) • Selenium & ImageMagick & AShot Example • Q&A
  • 7. What is Visual Test Automation? • Verifies the GUI is displayed as expected to the end users. • Focuses on visual contents: • Colors • Shapes • Sizes • Locations of elements UI Test vs Visual Test
  • 8. Why do We do Visual Testing? WordPress Template CSS animations Widgets Sliders etc. Mobile App Generation Engine .ipa .apk GUI MUST APPEAR CORRECTLY USER INTEARCTIONS COMPANY BRAND CRITICAL PRODUCTS and SERVICES
  • 9. Why do We Automate Visual Testing? Variety of Test Environments • Browsers – Mobile Devices – Resolutions etc. Time to Market Pressure • Release cycles getting shorter. Manual Visual Testing is Cumbersome • Human eyes error-prone and getting blind. In Mobile World, you will live with visual bugs longer • Can not update mobile app daily.
  • 10. What are the Challenges? • Anti-aliasing
  • 11. What are the Challenges? • Dynamic Content (CSS Animations, GIFs)
  • 12. What are the Challenges? Dynamic content Dynamic Content Auto-Kerning Offsets
  • 14. PhantomCSS (Open-Source by Huddle, 4197+ Stars on GitHub) • PhantomJS (Webkit) and SlimerJS (Gecko)Browsers • CasperJSNavigation • ResembleJSComparison • Ignores Colors, Antialiasing, Moving Elements Features
  • 15. WebdriverCSS (Open-Source, 447+ Stars on GitHub) • Chrome, Firefox, PhantomJSBrowsers • WebdriverIO v2.0 Selenium Bindings for NodeJS Navigation • GraphicsMagickComparison • Ignores Color, AntialiasingFeatures
  • 16. Wraith (Open-Source by BBC, 3883+ Stars on GitHub) • PhantomJS, SlimerJSBrowsers • Configuration Based .yaml file • CasperJS Navigation • ImageMagickComparison • Fuzz Option • Antialiasing and small changes Features
  • 17. • and many tools exists in the market both open-source and commercial. • FBSnapshotTestCase • Needle • Rspec Page Regression • Pix-Diff • Selenium Visual Diff • Vizregress • VisualCeption • Specter • Fighting Layout Bugs • dpdxt • Huxley • SiteEffect • Shoov • Screener.io • BaskstopJS • CSSCritic • Grunt Photobox • VIFF • GreenOnion • Kobold • CSS Visual TestAsd • Snap And Compare • Grunt-Vigo • Hardy • Browsershots • Screenbeacon • VisualReview • Gemini
  • 19. What is Applitools Eyes? • Automated Visual Testing Tool for Web sites and Mobile apps • Finds Visual Differences with Several Match Levels • Eyes SDK for Selenium & Appium • Cloud-Based Clean and Informative Dashboard
  • 20. How Does it Work? Visually notifies the differences At 2nd run and more it compares actual screenshots with the baselines. At 1st run it saves all screenshots as baseline Takes screenshots with Eyes SDK and sends to the Applitools cloud
  • 21. Match Levels and Their Meanings? • Pixel by Pixel ComparisonEXACT • Mimics the human eyes. • Ignores trivial mismatches (antialiasing, small pixel movements, etc.) STRICT • Similar with STRICT plus it ignores color changes.CONTENT • Compares the layouts. • Checks the elements locations. LAYOUT
  • 22. 4 Main Steps of Eyes SDK Close the Test eyes.close(); Add UI validation Check Points eyes.checkWindow("Validation Window Name"); Start a Test eyes.open(driver, APP_NAME, TEST_NAME); Create and Configure an Eyes Object Eyes eyes = new Eyes();
  • 23. Mobile Visual Testing Example Open BitbarSampleApp.apk * Visually check that start screen as expected? Click second option “Use Testdroid Cloud” *Visually check that Second Option is clicked? Write “SW Test Academy” to text bar Click Answer button Wait until the second page appear *Visually check that the answer is correct? Close the driver.
  • 24. Mobile Visual Testing Example Step-1: Install Eyes SDK with Maven Dependency <dependency> <groupId>com.applitools</groupId> <artifactId>eyes-selenium-java</artifactId> <version>RELEASE</version> </dependency> Step-2: Do Appium, Android SDK and GenyMotion Settings
  • 25. Mobile Visual Testing Example Step-3: Configure Eyes SDK in your Setup Method
  • 26. Mobile Visual Testing Example Step-4: Open Eyes  Do Visual Check  Close Eyes Open Eyes! Perform a Visual Check! Close Eyes! Abort if Eyes not closed!
  • 27. Mobile Visual Testing Example Step-5: Run and Check Results – First RUN (BASELINES)
  • 28. Mobile Visual Testing Example Step-5: Run and Check Results – PASSED RESULTS
  • 29. Mobile Visual Testing Example Step-5: Run and Check Results – FAILED RESULTS
  • 32. What is Galen Framework? Automated LAYOUT and RESPONSIVE testing framework. • Runs in Selenium Grid (SauceLabs & BrowserStack) • Supports Parallel Testing
  • 33. Programming Languages • Basic Syntax • JavaScript • JAVA & Selenium Webdriver & TestNG/Junit 
  • 34. Galen Reporting • Error Reporting Generates HTML reports where you can see all your test objects • Screenshots Highlights the misaligned elements • Image Comparison Compares images and shows differences
  • 35. Galen Example with JAVA & Webdriver & TestNG Logo: 31 pixel below from the header Header: 0px to the right, left, top Navigation Links: Horizontally aligned. Logo should displayed correctly.
  • 36. Galen Example with JAVA & Webdriver & TestNG Step-1: Installation with Maven Dependency <dependency> <groupId>com.galenframework</groupId> <artifactId>galen-java-support</artifactId> <version>2.3.2</version> </dependency>
  • 37. Galen Example with JAVA & Webdriver & TestNG Step-2: Write a Galen Specifications (.gspec) web elementsfor desktop Declaring locations tagging Image Comparison loops 5
  • 38. Galen Example with JAVA & Webdriver & TestNG Step-3: Write your Test Code Get Layout Report Get Galen Test Information from Layout Report Generate HTML Report based on Galen Test Information
  • 39. Galen Example with JAVA & Webdriver & TestNG Step-4: Folder Structure
  • 40. Galen Example with JAVA & Webdriver & TestNG Step-5: Run the Test and Check The Results Galen Test Report
  • 41. Galen Example with JAVA & Webdriver & TestNG Homepage Layout Report
  • 42. Galen Example with JAVA & Webdriver & TestNG LAYOUT ERRORS
  • 43. Galen Example with JAVA & Webdriver & TestNG HEATMAP
  • 44. Galen Example with JAVA & Webdriver & TestNG IMAGE COMPARISON ERRORS
  • 45.
  • 46. What is Percy? Visual regression testing and review platform. • COMPARES images, FINDS differences. • We can REVIEW and APPROVE changes. • Supports RESPONSIVE Design testing. • Prevents FALSE-POSITIVES. • PARALLEL TESTING support. • Integrated with GitHub and many CI tools.
  • 47. Which Technologies Does it Support? CI Tool Integrations Languages/Clients Travis CI Ember CircleCI Ruby – Capybara Semaphore Python – Selenium (BETA) Codeship Static websites Buildkite Drone Jenkins
  • 48. How Does it Work? When commit any code changes.
  • 49. Installation Ember Percy Requirements for Ember Percy with Jenkins and GitHub git node.js ember.js ember- percy Phantom.js bower Jenkins GitHub
  • 50. Percy Installation Steps (Percy Side) • Go to Percy.io and click Sign In WITH GITHUB. • Go to Percy Dashboard and Create an Organization • Install GitHub Integration • Create a project and get your CI integration variables: PERCY_TOKEN & PERCY_PROJECT
  • 51. Percy Installation Steps (Jenkins Side) • Set your PERCY_TOKEN and PERCY_PROJECT environment variables • Do GitHub Integration settings and Create a Jenkins Job. • Do your Ember Project’s Repository settings. • Add build and test Windows Batch commands: • For BUILD: • For TEST: npm install && bower install npm test
  • 52. How to Write Test with Ember-Percy? percySnapshot(name, options); scope  For element to snapshots. Default is full page. percySnapshot('homepage', {scope: '#header'}); Takes ScreenShots
  • 53. Sample Test Code Official TODO Example of Percy Navigate the homepage Take ScreenShot Write sth to the bar and Press Enter Assertions Take Final ScreenShot
  • 54. Responsive Design Test Code Define Resolutions by Screen Widths
  • 55. First Run  No Comparison (BASELINES)
  • 56. Second Run  PASSED!
  • 57. Third Run  FAILED!
  • 58. Visual Test Automation by Using ImageMagick & Selenium & AShot
  • 59. What is ImageMagick? • Open-source software suite that manipulates images in a variety of formats (over 200) including PNG, JPEG, GIF, etc. • Edits, Converts, Resizes, Compares, Rotates, Adjusts Colors etc. • For JAVA it has Im4java which is a pure-java interface.
  • 60. What is AShot? • Yandex's screenshot utility which takes, crops, prettifies and compares screenshots. • Entire Page • Web Element
  • 61. Example Test Scenario (Basic CSS Animation Check) • Open www.kariyer.net • Unhide text area of Uzman Photo • Hover on the “UZMAN” weblement on main page. • Wait 2 seconds to finish CSS animation • Take screenshot of an element and save as Baseline for the 1st Run. • For 2nd and more runs COMPARE baseline image with actual image. • Put all differences in "Differences folder" HOVER BASELINE
  • 62. Example Test Scenario (Basic CSS Animation Check) • Step-1: Install ImageMagick with all options and add to system path.
  • 63. Example Test Scenario (Basic CSS Animation Check) • Step-2: Create a Selenium & TestNG project and add dependencies
  • 64. Example Test Scenario (Basic CSS Animation Check) Test Method’s Code AShot ImageMagick JavascriptExecutor
  • 65. Example Test Scenario (Basic CSS Animation Check) How to Take Screenshot with AShot
  • 66. Example Test Scenario (Basic CSS Animation Check) If Baseline Exists, Do Comparison!
  • 67. ImageMagick Comparison ImageMagick Configurations Add images to ImageMagick Operation object for comparison Do Comparison!
  • 68. First Run Test ScreenShot Folder is created by using Test Name

Editor's Notes

  1. - We have 5.6 million visitors and 180 million page views per month - We hold more than 25 million resumes in our databases - We have more than 75 (seventy five thousand) customers.
  2. SW Test Academy is a technical software testing blog. We generally share technical articles on test automation, performance testing, security testing, DevOps practices and continuous integration. You can also join our newsletter and stay tuned for the latest articles.
  3. What is Visual Test Automation? Why do We Need to do Visual Testing? Why do We Automate? What are the Challenges? Visual Test Automation Tools Brief Overview of Visual Test Automation Tools Detailed Reviews (Applitools Eyes, Percy.io, Galen Framework) Selenium & ImageMagick & Ashot Example Q&A
  4. Visual test automation is a software test automation activity which verifies that the GUI is displayed as expected to the end users. We check shapes, colors, locations of elements and verify that UI itself correctly displayed. By using Selenium, we do UI test automation. We interrogate, manipulate web elements and add verifications to check system’s functionality.
  5. There mustn't be any overlap between each element. People may ridicule about your system. If you are a WordPress Template company or if you provide a mobile app generation core which outputs ipa (IOS) and apk (Android) files, your product has to generate visually correct results. Beucase, customers rely on your product and it must be functionally and visually perfect.
  6. - It is not feasible to cover all test matrix in a sprint. It takes too much time. - In agile world, release cycles are getting shorter. - If you do manual visual testing sprint by sprint, your eyes are getting blind and you can not detect the bugs.
  7. Basically, antialiasing means making the edge of an image much smoother and nicer. This enhances image quality. Because of graphics card’s rendering engine or antialiasing option settings, images rendered not the same in each machine. Thus, if we do pixel by pixel comparison, we will get mismathces and our test will fail.
  8. The another big challenge is dynamic content in visual testing. You have to do something to eliminate this problem such as hiding those elements, stopping them or wait to finish animations etc.
  9. Auto-kerning and dynamic letter movements sometimes causes mismatches thus visual testing tool has to be configured to handle this kind of movement problems. For example, adding pixel paddings sometimes causes offset problems. Your tool has to be capable to handle this problem. Also, there are many problems exists in visual testing. We have to handle them with strategies and our tool’s capabilities.
  10. PhantomJS runs on Wekit and pure headless browser. SlimerJS runs on Gecko (firefox) and not natively headless browser. Resemble.js analyses and compares images with HTML5 canvas and JavaScript.
  11. Define specific areas/Exclude specific areas/Sync Taken Images/Multiple Resolutions WebdriverCSS has sync option to use your taken images any environment. WebdriverCSS isn't yet compatible with WebdriverIO v3.0
  12. Look-same is a node.js library for comparing images It has strict mode like Applitools Eyes and you can modify tolerance, pixel ratio, antialiasing and text caret option.
  13. Configurations done by .yaml files (snap_file, domains, directory, screen-widths etc.)
  14. Add a Test Group Add a Browser Add Pages Run Test
  15. You can find the details of this example on swtestacademy.com. First, we open Bitbar apk….
  16. Step2: Install Appium, Android SDK, and GenyMotion Emulator (because it is faster). Then do required settings.
  17. Passing Test Scenario
  18. Failing Test Scenario
  19. Who knows GalenFramework?
  20. LAYOUT: It tests location of objects relatively to each other on a page. RESPONSIVE: It Opens  Resizes  Runs the Tests based on given Galen Specifications. Grid: You can test responsive websites on different mobile devices and resolutions. Parallel: Tests runs faster and we save time.
  21. First, we need to declare web elements Then, we can put tags for our pages by using equality sign Also, we can group elements by using @on desktop declaration Under the desktop, we can write our elements location We can do image comparison with given error ratio. And we can use loops to handle list elements
  22. First, we need to set the browser size with required dimensions. ((JavascriptExecutor) driver).executeScript("return document.documentElement.clientWidth") ((JavascriptExecutor) driver).executeScript("return document.documentElement.clientHeight") http://isgarlo.tumblr.com/post/110815604942/webdriver-how-to-set-the-browser-viewport-size
  23. Step1: We check Layout with Galen.checklayout() function and get layoutReport Step2: We get Galen Test Information based on layoutReport Step3: We build HTML report based on Galen Test Information Step4: If there is a layout problem, test asserts a fail.
  24. Does anyone know Percy? Or Did anybody use Percy before?
  25. RESPONSIVE: We should simply provide a list of breakpoint widths and then Percy take care of the rest. ANIMATIONS: It freezes different kinds of animations that can cause false-positive visual diffs. 1) It freezes animated GIFs on the FIRST FRAME. 2) It freezes most CSS animation and transition styles
  26. Static: A command-line client for static websites.
  27. You can push your code changes or do pull request to the github repository then Jenkins triggered and run your tests, Percy takes DOM snapshots and uploads to Percy Server, and then it compares them with the Baseline images and you will see «4 visual diffs need review»  and when you approved them you will see that "@OnurBaskirt approved 4 visual differences".
  28. Add all installed tools to system path. Ember, Phantoms.js, Bower, npm, and node.
  29. Save this variables to use Jenkins or another CI tool.
  30. Start Jenkins with Admin User. It is so critical to prevents “is not recognized command” problems.
  31. For taking elements snapshots, we can use scope option. When we use header’s CSS path, it takes header screenshot
  32. You can do responsive desing testing with Ember Percy very easily. You need to declare your environments widths and give tags to them such as desktop, mobile, tablet. Also you can define default Breakpoints. When you run your tests, you can override default breakpoints at percySnapshot’s function.
  33. When we run our test, at first run Percy does not do any comparison. It saves all images as baseline.
  34. This is the Passing Test Scenario
  35. I played with the test page and I added an extra line to the footer and Percy got the mismatch and highlight it.
  36. doComparison method is in our BaseTest Class and it comprises of baselineScreenShotPath, actualScreenshotPath and differencesScreenShotPath variables.
  37. -First we need to do ImageMagick configurations Then, add expected, actual and difference image paths to the ImageOperation object Finally we will use compare.run method to do comparison.
  38. At first run, code creates Differences and ScreenShots folder and takes baseline screenshot and creates a folder by using test name and put baseline screenshot into this folder. It always takes actual screenshot and put it under test folder. It has not any side effect.
  39. At seconde run, code checks that is there any baseline image exists? If yes, it compares baseline image with actual one and create a difference image.
  40. In order to control fail case, I draw some random sketch on baseline image and then run the test again.
  41. It gives an error and you can see differences both in test folder and differences folder.