+ All Categories
Home > Software > Selenium Based Visual Test Automation

Selenium Based Visual Test Automation

Date post: 11-Jul-2015
Category:
Upload: adamcarmi
View: 1,113 times
Download: 0 times
Share this document with a friend
Popular Tags:
49
Adam Carmi (@carmiadam) Co-Founder and VP R&D at Applitools [email protected] SELENIUM BASED VISUAL TEST AUTOMATION
Transcript
Page 1: Selenium Based Visual Test Automation

Adam Carmi (@carmiadam)

Co-Founder and VP R&D at Applitools

[email protected]

SELENIUM BASED VISUAL TEST

AUTOMATION

Page 2: Selenium Based Visual Test Automation

YOU CAN AND SHOULD

AUTOMATE YOUR

VISUAL TESTS!

Page 3: Selenium Based Visual Test Automation
Page 4: Selenium Based Visual Test Automation

AGENDA

Why automated visual testing?

Tools & Technology

Where does it fit?

Page 5: Selenium Based Visual Test Automation

WHAT IS VISUAL TESTING?

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

Page 6: Selenium Based Visual Test Automation

A VISUAL BUG

Page 7: Selenium Based Visual Test Automation

AND ANOTHER…

Page 8: Selenium Based Visual Test Automation

WHY SHOULD IT BE AUTOMATED?

THE TEST MATRIX IS TOO BIG TO APPROXIMATE MANUALLY Web browsers

Operating systems

Screen resolutions

Responsive designs

L10n

Page 9: Selenium Based Visual Test Automation

WHY SHOULD IT BE AUTOMATED?

Page 10: Selenium Based Visual Test Automation

MANUALVISUALTESTINGISERRORPRONE

WHY SHOULD IT BE AUTOMATED?

Page 11: Selenium Based Visual Test Automation

WHY SHOULD IT BE AUTOMATED?

Many are already doing it (and sharing)…

PhantomCSS Fighting Layout Bugs

CSS Critc

Wraith

Needle

Grunt PhotoBox

dpdxt

WebdriverCSS

EyesHuxley

FBSnapshotTestCase

GeminiSelenium Visual Diff

VisualCeption

Specter

Snap And Compare

Page 12: Selenium Based Visual Test Automation

AGENDA

Why automated visual testing?

Tools & Technology

Where does it fit?

Page 13: Selenium Based Visual Test Automation

THE WORKFLOW

Drive the AUT and take screenshots

Compare screenshots with baseline images

Report differences

Update the baseline

Page 14: Selenium Based Visual Test Automation

DEMOhttps://github.com/webdriverio/webdrivercss

Page 15: Selenium Based Visual Test Automation

THE WORKFLOW

Drive the AUT and take screenshots

Compare screenshots with baseline images

Report differences

Update the baseline

Page 16: Selenium Based Visual Test Automation

DRIVING AND CAPTURING

OTHER

PhantomCSS (CasperJS)

Fighting Layout Bugs (Java)CSS Critic (URLs)Wraith (URLs)

Needle (Python)Grunt PhotoBox (URLs)

WebdriverCSS (JS)

Eyes (All)

Huxley (RP)

FBSnapshotTestCaseSelenium Visual Diff (Java)

VisualCeption (PHP)

Specter (JS)

Wraith-Selenium (Ruby)

Snap And Compare (URLs)

Eyes (All)

Gemini (JS)

dpdxt (URLs)

Gemini (JS)

Page 17: Selenium Based Visual Test Automation

SCREENSHOTS

Real browsers? Full page? Frames? Regions? Viewport size? Page stabilization? Page preparation?

Page 18: Selenium Based Visual Test Automation

THE WORKFLOW

Drive the AUT and take screenshots

Compare screenshots with baseline images

Report differences

Update the baseline

Page 19: Selenium Based Visual Test Automation
Page 20: Selenium Based Visual Test Automation

WHY NOT?

FALSE POSITIVES

Page 21: Selenium Based Visual Test Automation

ANTI-ALIASING?

Page 22: Selenium Based Visual Test Automation

ANTI ALIASING 1/2

Page 23: Selenium Based Visual Test Automation

ANTI ALIASING 2/2

Page 24: Selenium Based Visual Test Automation

BRIGHTNESS 1/2

Page 25: Selenium Based Visual Test Automation

BRIGHTNESS 2/2

Page 26: Selenium Based Visual Test Automation

SUB PIXEL SHIFTS 1/2

Page 27: Selenium Based Visual Test Automation

SUB PIXEL SHIFTS 2/2

Page 28: Selenium Based Visual Test Automation

SUB PIXEL SHIFTS 1/2

Page 29: Selenium Based Visual Test Automation

SUB PIXEL SHIFTS 2/2

Page 30: Selenium Based Visual Test Automation

ANDMORE…

1 pixel offsets in element positioning

Dynamic content

Moving elements

Images of different size

Page 31: Selenium Based Visual Test Automation
Page 32: Selenium Based Visual Test Automation

Image Comparison APIs

Page 33: Selenium Based Visual Test Automation

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

Page 34: Selenium Based Visual Test Automation

Resemble.js An image comparison tool 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/

Page 35: Selenium Based Visual Test Automation

Applitools Eyes A specialized image processing stack designed to compare

computer generated UI images

Anti-aliasing

Partial and full pixel offsets

Images of different size

Dynamic content

Moving elements

Layout matching

Available as a cloud service

Page 36: Selenium Based Visual Test Automation

DEMO

Page 37: Selenium Based Visual Test Automation

THE WORKFLOW

Drive the AUT and take screenshots

Compare screenshots with baseline images

Report differences

Update the baseline

Page 38: Selenium Based Visual Test Automation

REPORT DIFFERENCESAs files on the file system (combined with source control)

Page 39: Selenium Based Visual Test Automation

REPORT DIFFERENCESAs a Gallery (example from Selenium Visual Diff)

Page 40: Selenium Based Visual Test Automation

THE WORKFLOW

Drive the AUT and take screenshots

Compare screenshots with baseline images

Report differences

Update the baseline

Page 41: Selenium Based Visual Test Automation

UPDATE THE BASELINE

Rename or commit individual image files

Overwrite mode

Page 42: Selenium Based Visual Test Automation

UPDATE THE BASELINE

GUI (Gemini GUI)

Automatic maintenance (demo)

Page 43: Selenium Based Visual Test Automation

AGENDA

Why automated visual testing?

Tools & Technology

Where does it fit?

Page 44: Selenium Based Visual Test Automation

WHERE DOES IT FIT?

• Component

s

• Code

review

• Developers

• Designers

• QA

Page 45: Selenium Based Visual Test Automation

WHERE DOES IT FIT?

• Pages

• Page

sections

• Developers

• Designers

• QA

• Others

Page 46: Selenium Based Visual Test Automation

WHERE DOES IT FIT?

• Staging vs.

Production

• Ops

• QA

Page 47: Selenium Based Visual Test Automation

WHERE DOES IT FIT?

• Monitoring

• Ops

• QA

Page 48: Selenium Based Visual Test Automation

QUESTIONS?

Page 49: Selenium Based Visual Test Automation

Adam Carmi (@carmiadam)

Co-Founder and VP R&D at Applitools

[email protected]

THANK YOU


Recommended