advanced automated visual testing with selenium

47
Adam Carmi (@carmiadam) Co-Founder and VP R&D at Applitools ADVANCED AUTOMATED VISUAL TESTING WITH SELENIUM

Upload: adamcarmi

Post on 16-Apr-2017

364 views

Category:

Software


2 download

TRANSCRIPT

Page 1: Advanced automated visual testing with Selenium

Adam Carmi (@carmiadam)Co-Founder and VP R&D at Applitools

ADVANCED AUTOMATED VISUAL TESTING WITH

SELENIUM

Page 2: Advanced automated visual testing with Selenium

YOU CAN AND SHOULD

AUTOMATE YOUR VISUAL TESTS!

Page 3: Advanced automated visual testing with Selenium
Page 4: Advanced automated visual testing with Selenium

AGENDA

Why automated visual testing? Tools & Technology Where does it fit? Q & A

Page 5: Advanced automated visual testing with Selenium

WHAT IS VISUAL TESTING?

A quality assurance activity aimed to verify that a Graphical User Interface appears correctly to users

Page 6: Advanced automated visual testing with Selenium
Page 7: Advanced automated visual testing with Selenium
Page 8: Advanced automated visual testing with Selenium
Page 9: Advanced automated visual testing with Selenium
Page 10: Advanced automated visual testing with Selenium

WHY AUTOMATE?

The test matrix is too big to cover manually Web browsers Devices Operating systems Screen resolutions Responsive design L10n 3rd Party upgrades

Page 11: Advanced automated visual testing with Selenium

WHY AUTOMATE?

Mobile apps quality is critical

Harder to roll back changes Can’t push daily

Updates take battery and data

Higher quality bar

Page 12: Advanced automated visual testing with Selenium

WHY AUTOMATE?

Release cycles keep getting shorter

Page 13: Advanced automated visual testing with Selenium

AGENDA

Why automated visual testing? Tools & Technology Where does it fit? Q & A

Page 14: Advanced automated visual testing with Selenium

HOW DOES IT WORK?

Drive the AUT and take screenshots

Compare screenshots with baseline images

Report differences

Update the baseline

Page 15: Advanced automated visual testing with Selenium

DEMOWebDriverCSS

Page 16: Advanced automated visual testing with Selenium

HOW DOES IT WORK?

Drive the AUT and take screenshots

Compare screenshots with baseline images

Report differences

Update the baseline

Page 17: Advanced automated visual testing with Selenium
Page 18: Advanced automated visual testing with Selenium
Page 19: Advanced automated visual testing with Selenium
Page 20: Advanced automated visual testing with Selenium
Page 21: Advanced automated visual testing with Selenium
Page 22: Advanced automated visual testing with Selenium
Page 23: Advanced automated visual testing with Selenium
Page 24: Advanced automated visual testing with Selenium

AND MORE… 1 pixel offsets in element positioning Dynamic content Moving elements Images of different size Performance

Page 25: Advanced automated visual testing with Selenium
Page 26: Advanced automated visual testing with Selenium

IMAGE COMPARISON ENGINES

Page 27: Advanced automated visual testing with Selenium

ImageMagick

A powerful command line tool for image processing.

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

Page 28: Advanced automated visual testing with Selenium

THE JAVASCRIPT ENGINES Resemble.js

Pixel by pixel + error ratio + anti-aliasinghttp://huddle.github.io/Resemble.js

Blink-DiffPixel by pixel + error ratio + anti-aliasing + perceptual color distance computationhttps://github.com/yahoo/blink-diff

Looks-SamePixel by pixel + perceptual color distance computation + ignore Carethttps://github.com/gemini-testing/looks-same

Page 29: Advanced automated visual testing with Selenium

APPLITOOLS EYES Handles anti-aliasing, pixel offsets, color similarity, and image

scaling

Dynamic and moving content

Compare images of different sizes

No error ratio configuration required

Validates full UI pages

Fast!

Supports layout / structure matching

Page 30: Advanced automated visual testing with Selenium

DEMOVISUAL LAYOUT MATCHING

Page 31: Advanced automated visual testing with Selenium

HOW DOES IT WORK?

Drive the AUT and take screenshots

Compare screenshots with baseline images

Report differences

Update the baseline

Page 32: Advanced automated visual testing with Selenium

QUICK FEEDBACK TOOLS

MOTIVATION Get fast feedback on code changes

Run tests locally in the background

SETUP Render screenshots with a

headless browser PhatomJS, SlimerJS

Configuration file driven testsCONS Partial coverage

Chrome, IE?

Old browser layout engine versions

Limited navigation

Page 33: Advanced automated visual testing with Selenium

VISUAL COVERAGE TOOLS

MOTIVATION Verify that the app / site looks

right in all real execution environments

Test as many UI states as possible

Execute many tests in parallel

SETUP Render screenshots using real

browsers on a variety of operating

systems and devices in parallel

WebDriver, Grid

Code driven tests

WebDriver, DSLCONS Requires test infrastructure

Implement and maintain test code

Page 34: Advanced automated visual testing with Selenium

SELENIUM BASED TOOLSCODE / SCRIPT● Needle (Python WD)● WebDriverCss (JS WebDriverIO)● Gemini (JS DSL)● Selenium Visual Diff (Java WD)● VisualCeption (PHP CodeCeption)● Pix-Diff (JS Protractor)● Shoov (JS WebDriverIO)● Vizregress (.NET WD)● Rspec Page Regression (Capibara)● Applitools Eyes (All WD + Appium)● Fighting Layout Bugs (Java WebDriver)● Huxley (Record Playback)

CONFIGURATION● Viff● CSS Visual Test● GreenOnion● Wraith-Selenium

Page 35: Advanced automated visual testing with Selenium

HOW DOES IT WORK?

Drive the AUT and take screenshots

Compare screenshots with baseline images

Report differences

Update the baseline

Page 36: Advanced automated visual testing with Selenium

REPORT DIFFERENCESAs files on the file system

WebDriverCSS

Page 37: Advanced automated visual testing with Selenium

REPORT DIFFERENCESAs a gallery

Selenium Visual Diff

Page 38: Advanced automated visual testing with Selenium

HOW DOES IT WORK?

Drive the AUT and take screenshots

Compare screenshots with baseline images

Report differences

Update the baseline

Page 39: Advanced automated visual testing with Selenium

UPDATE THE BASELINE

Gemini

Page 40: Advanced automated visual testing with Selenium
Page 41: Advanced automated visual testing with Selenium

DEMOAUTOMATED MAINTENANCE

Page 42: Advanced automated visual testing with Selenium

AGENDA

Why automated visual testing? Tools & Technology Where does it fit? Q & A

Page 43: Advanced automated visual testing with Selenium

WHERE DOES IT FIT?

• Components

• Code review

• Developers

• Designers• QA

Visual testing of frontend components by frontend developers

Page 44: Advanced automated visual testing with Selenium

WHERE DOES IT FIT?

• Pages• Page

sections

• Developers

• Designers• QA• Others

Full or partial validation of application screensA collaboration tool

Page 45: Advanced automated visual testing with Selenium

WHERE DOES IT FIT?

• Staging vs. Production

• Ops• QA

Validate your staging deployment using your production deployment as a baseline

Page 46: Advanced automated visual testing with Selenium

WHERE DOES IT FIT?

• Monitoring

• Ops• QA

No missing resources in productionNo corruption due to 3rd party dataNo corruption due to browser / OS upgrades

Page 47: Advanced automated visual testing with Selenium

Adam Carmi (@carmiadam)Co-Founder and VP R&D at Applitools

QUESTIONS?