SlideShare a Scribd company logo
Colorful world-of-visual-automation-testing-latest
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
Colorful world-of-visual-automation-testing-latest
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

PDF
IBM Jazz Agile Collaborative Lifecycle Management 6.0.x What's new
PDF
Test trend analysis: Towards robust reliable and timely tests
PPTX
Grading the Quality of Selenium Tests
PPTX
Design patterns in test automation
PPTX
Protractor framework – how to make stable e2e tests for Angular applications
PPTX
Testing Metrics - Making your tests visible
PDF
End-to-End Test Automation for Both Horizontal and Vertical Scale
PPTX
Тестирование производительности клиентсайда
IBM Jazz Agile Collaborative Lifecycle Management 6.0.x What's new
Test trend analysis: Towards robust reliable and timely tests
Grading the Quality of Selenium Tests
Design patterns in test automation
Protractor framework – how to make stable e2e tests for Angular applications
Testing Metrics - Making your tests visible
End-to-End Test Automation for Both Horizontal and Vertical Scale
Тестирование производительности клиентсайда

Viewers also liked (17)

PPTX
SoapUI one key to all doors
PPTX
How does Java 8 exert hidden power on Test Automation?
PDF
WixAutomation - Test State Pattern - Selenium Camp 2017
PDF
iOS Parallel Automation: run faster than fast — Viktar Karanevich — SeleniumC...
PPTX
Test Automation Architecture in Microservices
PPTX
An easy way to automate complex UI
ODP
Fabulous Tests on Spock and Groovy
PDF
Better Bullshit Driven Development [SeleniumCamp 2017]
PPTX
5 top pain points of test automation
PDF
Excuse me, sir, do you have a moment to talk about tests in Kotlin
PPTX
Selenium Overview - By Adam Carmi
PDF
XpDays - Automated testing of responsive design (GalenFramework)
PPTX
Get responsive with Galen
PDF
Automating the responsive website testing
PDF
Testing responsive web design pdf
PPT
Responsive Web Design testing using Galen Framework
PPTX
Visual Regression Testing
SoapUI one key to all doors
How does Java 8 exert hidden power on Test Automation?
WixAutomation - Test State Pattern - Selenium Camp 2017
iOS Parallel Automation: run faster than fast — Viktar Karanevich — SeleniumC...
Test Automation Architecture in Microservices
An easy way to automate complex UI
Fabulous Tests on Spock and Groovy
Better Bullshit Driven Development [SeleniumCamp 2017]
5 top pain points of test automation
Excuse me, sir, do you have a moment to talk about tests in Kotlin
Selenium Overview - By Adam Carmi
XpDays - Automated testing of responsive design (GalenFramework)
Get responsive with Galen
Automating the responsive website testing
Testing responsive web design pdf
Responsive Web Design testing using Galen Framework
Visual Regression Testing
Ad

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

PPTX
Introduction to automated visual testing
PDF
Adam carmi
PPTX
Advanced automated visual testing with Selenium
PPTX
Visual regression with applitools eyes
PDF
Visual Testing: Quality and Speed -- by GIl Tayar, Applitools
PPTX
Advanced Automated Visual Testing
PPTX
Growing Trends of Open Source UI Frameworks
PPTX
SeConf2015: Advanced Automated Visual Testing With Selenium
PDF
Visual Automation Framework via Screenshot Comparison
PPTX
Test Smarter Not Harder - how to design tests for continuous delivery
PDF
Appium Interview Questions and Answers | Edureka
PDF
Web Test Automation Framework - IndicThreads Conference
PPTX
Advanced Visual Test Automation with Selenium
PPTX
Microsoft DevOps Solution - DevOps
PPTX
Automated Visual Testing That Does Not Suck
PPTX
Automated Visual Testing That Doesn't Suck!
PDF
[webinar] Cutting-edge Functional UI Testing Techniques - w/ Adam Carmi
PPTX
Udvid din test portefølje med coded ui test og cloud load test
PPT
Behavior Driven Development by Example
PPTX
Selenium Based Visual Test Automation
Introduction to automated visual testing
Adam carmi
Advanced automated visual testing with Selenium
Visual regression with applitools eyes
Visual Testing: Quality and Speed -- by GIl Tayar, Applitools
Advanced Automated Visual Testing
Growing Trends of Open Source UI Frameworks
SeConf2015: Advanced Automated Visual Testing With Selenium
Visual Automation Framework via Screenshot Comparison
Test Smarter Not Harder - how to design tests for continuous delivery
Appium Interview Questions and Answers | Edureka
Web Test Automation Framework - IndicThreads Conference
Advanced Visual Test Automation with Selenium
Microsoft DevOps Solution - DevOps
Automated Visual Testing That Does Not Suck
Automated Visual Testing That Doesn't Suck!
[webinar] Cutting-edge Functional UI Testing Techniques - w/ Adam Carmi
Udvid din test portefølje med coded ui test og cloud load test
Behavior Driven Development by Example
Selenium Based Visual Test Automation
Ad

Recently uploaded (20)

PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
L1 - Introduction to python Backend.pptx
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
top salesforce developer skills in 2025.pdf
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Introduction to Artificial Intelligence
PPTX
ai tools demonstartion for schools and inter college
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
Transform Your Business with a Software ERP System
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PPTX
ISO 45001 Occupational Health and Safety Management System
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Which alternative to Crystal Reports is best for small or large businesses.pdf
L1 - Introduction to python Backend.pptx
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Odoo Companies in India – Driving Business Transformation.pdf
Odoo POS Development Services by CandidRoot Solutions
top salesforce developer skills in 2025.pdf
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
VVF-Customer-Presentation2025-Ver1.9.pptx
Introduction to Artificial Intelligence
ai tools demonstartion for schools and inter college
PTS Company Brochure 2025 (1).pdf.......
Transform Your Business with a Software ERP System
2025 Textile ERP Trends: SAP, Odoo & Oracle
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
ISO 45001 Occupational Health and Safety Management System
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Upgrade and Innovation Strategies for SAP ERP Customers
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf

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

  • 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
  • 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

  • #5: - 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.
  • #6: 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.
  • #7: 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
  • #8: 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.
  • #9: 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.
  • #10: - 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.
  • #11: 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.
  • #12: 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.
  • #13: 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.
  • #15: 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.
  • #16: 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
  • #17: 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.
  • #18: Configurations done by .yaml files (snap_file, domains, directory, screen-widths etc.)
  • #19: Add a Test Group Add a Browser Add Pages Run Test
  • #26: You can find the details of this example on swtestacademy.com. First, we open Bitbar apk….
  • #27: Step2: Install Appium, Android SDK, and GenyMotion Emulator (because it is faster). Then do required settings.
  • #31: Passing Test Scenario
  • #32: Failing Test Scenario
  • #34: Who knows GalenFramework?
  • #35: 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.
  • #40: 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
  • #41: 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
  • #42: 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.
  • #49: Does anyone know Percy? Or Did anybody use Percy before?
  • #50: 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
  • #51: Static: A command-line client for static websites.
  • #52: 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".
  • #53: Add all installed tools to system path. Ember, Phantoms.js, Bower, npm, and node.
  • #54: Save this variables to use Jenkins or another CI tool.
  • #55: Start Jenkins with Admin User. It is so critical to prevents “is not recognized command” problems.
  • #57: For taking elements snapshots, we can use scope option. When we use header’s CSS path, it takes header screenshot
  • #59: 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.
  • #60: When we run our test, at first run Percy does not do any comparison. It saves all images as baseline.
  • #61: This is the Passing Test Scenario
  • #62: I played with the test page and I added an extra line to the footer and Percy got the mismatch and highlight it.
  • #71: doComparison method is in our BaseTest Class and it comprises of baselineScreenShotPath, actualScreenshotPath and differencesScreenShotPath variables.
  • #72: -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.
  • #73: 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.
  • #74: 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.
  • #75: In order to control fail case, I draw some random sketch on baseline image and then run the test again.
  • #76: It gives an error and you can see differences both in test folder and differences folder.