Upgrade to Pro — share decks privately, control downloads, hide ads and more …

#LDNSE 12 : Advanced Visual Test Automation With Selenium

730

#LDNSE 12 : Advanced Visual Test Automation With Selenium

Slides from talk on Advanced Visual Test Automation with Selenium at the London Selenium Meetup

London Selenium Meetup

March 20, 2015
Tweet

Transcript

  1. WHAT IS VISUAL TESTING? A quality assurance activity aimed to

    verify that a Graphical User Interface appears correctly to users
  2. WHY SHOULD IT BE AUTOMATED? THE TEST MATRIX IS TOO

    BIG TO APPROXIMATE MANUALLY  Web browsers  Devices  Operating systems  Screen resolutions  Responsive designs  L10n
  3. WHY SHOULD IT BE AUTOMATED? NATIVE / HYBRID MOBILE APPS

     Harder to roll back changes  Can’t push daily  Updates take battery and data  Higher quality bar
  4. WHY SHOULD IT BE AUTOMATED? Many are already doing it

    (and sharing)… PhantomCSS Fighting Layout Bugs CSS Critc Wraith Needle Grunt PhotoBox dpdxt WebdriverCSS Eyes Huxley FBSnapshotTestCase Gemini SeleniumVisual Diff VisualCeption Specter Snap And Compare kobold
  5. THE WORKFLOW Drive the AUT and take screenshots Compare screenshots

    with baseline images Report differences Update the baseline
  6. THE WORKFLOW Drive the AUT and take screenshots Compare screenshots

    with baseline images Report differences Update the baseline
  7. DRIVING AND CAPTURING OTHER • Wraith (URLs) • PhantomCSS (CJS)

    • dpdxt (URLs) • Grunt PhotoBox (URLs) • Snap And Compare (URLs) • Specter (JS) • Gemini (JS) • Grunt-Vigo (URLs) • WebDriverCSS (JS) • Fighting Layout Bugs (Java) • Wraith-Selenium (Ruby) • Selenium Visual Diff (Java) • Needle (Python) • VisualCeption (PHP) • Huxley (RP) • Gemini (JS) • Vizregress (.NET) • Visualci (Java) • Viff (JS) • Pix-Diff (JS) • Applitools Eyes (All) • CSS Critic (URLs) • FBSnapshotTestCase (XCTest) • Kobold (folders) • Applitools Eyes (All)
  8. SCREENSHOTS  Real browsers?  Full page?  Frames? 

    Regions?  Viewport size?  Page stabilization?  Page preparation?
  9. THE WORKFLOW Drive the AUT and take screenshots Compare screenshots

    with baseline images Report differences Update the baseline
  10. AND MORE… 1 pixel offsets in element positioning Dynamic content

    Moving elements Images of different size Performance
  11. ImageMagick  A powerful command line tool for image processing.

     APIs are available for most programming languages.  Fuzzing is used to eliminate slight color differences  An error ratio is usually used to determine a match $ compare –metric AE –fuzz 5% img1.png img2.png diff.png 2246
  12. Resemble.js  An image comparison library implemented in Javascript 

    Used by PhantomCSS and other tools.  Good antialiasing support  An error ratio is usually used to determine a match  http://huddle.github.io/Resemble.js/
  13. Blink-Diff  An image comparison library implemented in Javascript 

    Can be operated from the command line using node  Perceptual color distance computation  Anti-aliasing support  An error ratio is used to determine a match  https://github.com/yahoo/blink-diff/
  14. Applitools Eyes  A specialized image processing stack designed to

    compare computer generated UI images  Anti-aliasing, pixel offsets, and image scaling with low false negative rate  Dynamic and moving content  Compare images of different sizes  No error ratio configuration required  Fast!  Layout matching  Available as a cloud service
  15. THE WORKFLOW Drive the AUT and take screenshots Compare screenshots

    with baseline images Report differences Update the baseline
  16. THE WORKFLOW Drive the AUT and take screenshots Compare screenshots

    with baseline images Report differences Update the baseline
  17. WHERE DOES IT FIT? • Pages • Page sections •

    Developers • Designers • QA • Others