SlideShare a Scribd company logo
Quality Assurance
Continuous
…using Selenium WebDriver
San Francisco Selenium Meetup Group - May 16, 2013
Fabrizio
BrancaLead System Developer at
San Francisco, CA
Janine
Fiona
that’s me
It’s a boy!
E-Commerce:
Magento
CMS:
TYPO3
Portals:
ZF, FLOW,…
Mobile Searchperience:
SOLR
120 people
in 7 offices
world-wide
High
Performance
/Scale
Global
Enterprise
Projects
Continuous
Integration
Deployment
Development
Delivery
Improvement
Quality Assurance
Continuous
Everything sounds better
with “continuous”
“Continuous”
==“Doingstuffoverandoveragain”
Builds
Deployment Tests Infrastructure
Setup
Devbox
Setup
== “Automation”
timespent
task size
does it
manually
does it
manually
gets annoyed
writes script to
automate
runs script
wins
loses
Geeks vs. Non-Geeks
Makes fun of geek’s
complicated method
— Ovidiu Platon
We are not shipping your machine!
if it works on your machine!
I don’t care
Picture
The BIG
Vagrant
Boxes
Awesome
stuff
Every single
line potentially
can break
production!
Bratwurst
(Germans)
Donut
(Americans)
Pizza
(Italians)
Version Control
GIT, SVN,…
PHP lint
Version Control Code Reviews
“Gerrit”
Code Reviews Build
Files
DB
Installer
Settings
Triggered by
commit, by time
or manually
Jenkins
minify js/css
.tar.gz
“virtual package”
(revision)
Multiple Release
Branches?*
Multiple Build
Pipelines!
…
…
…
*http://nvie.com/posts/a-successful-git-branching-model/
Version Control Code Reviews Build
Files
DB
Installer
Settings
Build
Files
B
ler
Settings
Static Code
Analysis
CodeSniffer
php-pmd
php-cpd
php-depend
Static Code
Analysis
Install on
“Integration”
First system where
code from all
developers/teams
meets each other
unstable system.
Might be broken.
Will be rebuild
without warning
Install on
“Integration”
Unit Tests
PHPUnit
Code
coverage
Unit Tests Integration Tests
AOE PMD
(for Magento)
broken links,
HTTP headers,
W3C validity,…
Test features that rely on other
parts (e.g. framework, external
services,…)
External components
(SSL, Redis, Varnish,…)
Basically this is also
PHPUnit, but
addressing other stuff
Integration Tests Acceptance Tests
Here we go:
Selenium!
Acceptance Tests
Install on
“Staging”
Behat
(Cucumber)
Same setup as production,
but different machines
Client QA /
approval
Install on
“Staging”
*http://www.slideshare.net/aoemedia/performance-measurement-and-tuning
Stress
Tests
Jmeter
Spin up EC2
instances in the
cloud to produce
traffic*
Again:
multiple servers or
autoscaling setup
Stress
Tests
Install on
“Production”
A/B
Deployments
on different
scales
Plan B:
rollback
Zero Downtime
Varnish ArrayEC2
Frontend ArrayBackend ArrayEC2 EC2
EC2
Worker ArrayEC2EC2
Deployment x
ELB
Load Balancer
Route 53
DNS-Service
shop.angrybirds.com
Deployment
Varnish Array
Frontend Array Worker ArrayEC2
Deployment x
ELB
Load Balancer
VaEC2
FroBackend ArrayEC2 EC2
EC2
EC2
Deployment x+1
Release Y
ELB
Load Balancer
Route 53
DNS-Service
shop.angrybirds.com
Deployment
Stress
Tests
Install on
“Production”
Deployment !=
Feature Release
Install on
“Production”
Enable Features
Version
Control
Code
Reviews
Build Static Code
Analysis
Install on
“Integration”
Unit Tests Integration
Tests
Acceptance
Tests
Install on
“Staging”
Install on
“Production”
Enable
Features
Pipeline Visualization
#284
#283
#282
#281
#280
Build
Static Code
Analysis
Unit
Tests
Install on
“Integration”
Integration
Tests
Acceptance
Tests
#285
for team dashboards
Acceptance Tests
test automation
is a developer’s task
we need to provide
them some good tools…
us
Selenium1vs.
Selenium2
Continuous Quality Assurance using Selenium WebDriver
What’s out there?
Selenium for PHP
PHPUnit_Selenium
(Sebastian Bergmann)
WebDriver-PHP
(Chibimagic)
Php-webdriver-bindings
(Lukasz Kolczynski)
php-webdriver
PHPUnit_Selenium
(Giorgio Sironi)
php-webdriver
Selenium 2
08/2011 Facebook/php-webdriver (Justin Bishop)
Element-34/php-webdriver (Adam Goucher)
instaclick/php-webdriver (Anthon Pang)
php-webdriver
“A very thin wrapper
of WebDriver”
So what?
A thin layer is good!
But not enough…
no test logic
no higher level
components
dealing with
Selenium specific tasks
not compatible to
legacy test cases
No abstraction /
structure
Architecture
HTTP
AUT
No direct access
(DB, classes,…)
REST*
(over HTTP)
*http://code.google.com/p/selenium/wiki/JsonWireProtocol
Continuous Quality Assurance using Selenium WebDriver
Project test cases
PHPUnit
Project Components
Components Library
Menta
php-webdriver
reusable
project
specific
Menta
Selenium 2 Testing Framework for PHP
Who is
“Menta”?
What is
“Menta”?
Why
“Menta”?
Continuous Quality Assurance using Selenium WebDriver
Features
MentaThe framework.
Not the cat…
Components Session Management
?Bonus Features :)Event / ObserverConfiguration Management
PHPUnit integration
Why?
✔
✔
✔
✔
✔
✔
✔
✔
✔
✔
✔
✔
Data Providers
✔
✔
✔
✔
✔
✔
✔
✔
✔
Dependent Tests
✔
✔
✔
✔
✔
✔
✔
✔
✔
✔
✔
✔
✔
✔
✔
✔
✔
✔
✔
✔
✔
✔
✔
✔
Test Infrastructure
Menta for PHPUnit
Abstract test class
PHPUnit_Framework_TestCaseMenta_PHPUnit_Testcase_Selenium2ProjectY_Abstract_TestCase
Very thin layer on
top of PHPUnit
ProjectY_TestCase_Registration ProjectY_TestCase_Checkout
the “magic” happens
in the components
Legacy Selenium 1 tests
PHPUnit_Framework_TestCasePHPUnit_Extensions_SeleniumTestCase
ProjectY_TestCase_Registration ProjectY_TestCase_Checkout
Legacy Selenium 1 tests
PHPUnit_Framework_TestCaseMenta_PHPUnit_Testcase_Selenium2
ProjectY_TestCase_Registration ProjectY_TestCase_Checkout
Menta_PHPUnit_Testcase_Selenium1
Selenium1Facade
Compatible with
PHPUnit_Extensions_SeleniumTestCase
HTML ReportScreenshots
(on demand
and on failure)
test description
from phpdoc
additional
messages
error details
HTML Report“Duration
Heatmap”
shows long
running tests
Menta for PHPUnit
Text Result PrinterPHPUnit 3.7.20 by Sebastian Bergmann.
Configuration read from /var/www/Tests/Acceptance/conf/devfb.ff.vmhost.xml
> SUITE:
> SUITE:
> SUITE: Acceptance_Tests_Account_Register
> TEST: Acceptance_Tests_Account_Register::register
SUCCESS. (Duration: 8.18 sec)
> TEST: Acceptance_Tests_Account_Register::login
SUCCESS. (Duration: 6.5 sec)
> TEST: Acceptance_Tests_Account_Register::testRegistrationMail
FAILURE: Searching for mail with subject 'Welcome, Test_705b077a962977e1a412696ea42249ae User_705b077a962977e1a412696ea42249ae' timed out (Duration: 22
< Duration: 36 sec
< Duration: 36 sec
> SUITE:
> SUITE: Acceptance_Tests_Checkout_CheckoutMultiAddressTest
> TEST: Acceptance_Tests_Checkout_CheckoutMultiAddressTest::putProductsInCart
FAILURE: Element "//table[@id="shopping-cart-table"]//h3[contains(concat(' ', @class, ' '), ' attentionText ')]" does not contain text "Bulb Vase" Fail
< Duration: 9.87 sec
> SUITE: Acceptance_Tests_Checkout_CheckoutTest
> TEST: Acceptance_Tests_Checkout_CheckoutTest::categoryView
SUCCESS. (Duration: 1.79 sec)
> TEST: Acceptance_Tests_Checkout_CheckoutTest::putPlatterInCart
FAILURE: Failed asserting that two strings are equal. (Duration: 3.55 sec)
SKIPPED: This test depends on "Acceptance_Tests_Checkout_CheckoutTest::putPlatterInCart" to pass. (Duration: 5.34 sec)
Components?
Components!
Manager
Component
Menta_ComponentManager::get(‘PageObject_Cart’) PageObject_Cart
Rewrites
Component
PageObject_CartProjectZ_PageObject_Cart
extends
change
locators
add
functionality
change
behavior
overwrite
labels
Manager
Component
Menta_ComponentManager::get(‘PageObject_Cart’) ProjectZ_PageObject_Cart
Menta_ComponentManager::addRewrite(
‘PageObject_Cart’,
‘ProjectZ_PageObject_Cart’
);
Components
Common Assert Wait Screenshot Selenium1Facade
Imap WebService W3C Validator Curl …
Some might not even
require a Selenium session
Gallery
Screenshot
Components!
PageObjects?
PageObjectsComponents
{ }}⊇{ PageObjects are
components
PageObjects?
represents
services offered by
a page or feature
is the only thing with
a deep knowledge of
the HTML
clickCheckoutButton() isInCart($product) getTotals()
✔
✔
✔
Component
Libraries
Menta
Magento
(your library)
Project-
specific
Magento
(community-provided)
General
(your library)
Session
Management
Let Menta manage
your sessions
auto-close
auto-start
incl. on exceptions
and ctrl+c
Reusing sessions
Cleaning sessions
Configuration
ManagementFallback mechanism
for global settings
Create multiple
configurations for
different browsers,
application instances
or Selenium Servers
Compatible to
PHPUnit (xml)
Event / Observer
Menta_Events::dispatchEvent('after_session_create');
Menta_Events::addObserver('after_session_create', function($session) {
$session->window('main')->postSize(array('width' => 1024, 'height' => 768));
}
Bonus Features
Sauce Labs Support
*configuration: http://username:accesskey@ondemand.saucelabs.com:80/wd/hub
works fine*
update test
result (REST)
Sauce Labs Support
Speaking name Test results
Perceptual diffs
Build X
Build X-1
Perceptual
Diff
github.com / AOEmedia / Menta
github.com / AOEmedia / Menta_SampleProject
It’s composer based and
you’ can get started
in a few minutes!
Thank you!
Any questions?
http://www.aoemedia.com
http://www.fabrizio-branca.de
@fbrnc
Follow me on twitter!
My blog

More Related Content

ODP
Mastering selenium for automated acceptance tests
PPT
Web Test Automation with Selenium
PDF
Automation Testing using Selenium
PPT
Automated Web Testing Using Selenium
PPS
Selenium Demo
PDF
Selenium webdriver interview questions and answers
PPTX
Smarter ways to do selenium automation @ work, Selenium, automation
PDF
Selenium Ide Tutorial
Mastering selenium for automated acceptance tests
Web Test Automation with Selenium
Automation Testing using Selenium
Automated Web Testing Using Selenium
Selenium Demo
Selenium webdriver interview questions and answers
Smarter ways to do selenium automation @ work, Selenium, automation
Selenium Ide Tutorial

What's hot (20)

DOCX
Selenium WebDriver FAQ's
PPT
Selenium Concepts
ODP
Automated UI testing. Selenium. DrupalCamp Kyiv 2011
PPT
Selenium
DOCX
Selenium_WebDriver_Java_TestNG
PPT
Automation Testing on Selenium by Quontra Solutions
PPTX
Tech talks (Automation on Selenium Web Driver. How to begin & implement)
PPTX
Selenium Webdriver
PDF
Web application testing with Selenium
PPTX
Selenium WebDriver training
PDF
Testing PHP with Codeception
PPTX
Selenium WebDriver - Test automation for web applications
PPTX
Selenium topic 1- Selenium Basic
PPTX
Selenium- A Software Testing Tool
PDF
Selenium 2 - PyCon 2011
PPTX
Selenium
DOCX
Selenium interview Q&A
PPT
Selenium (1)
PDF
Acceptance testing in php with Codeception - Techmeetup Edinburgh
Selenium WebDriver FAQ's
Selenium Concepts
Automated UI testing. Selenium. DrupalCamp Kyiv 2011
Selenium
Selenium_WebDriver_Java_TestNG
Automation Testing on Selenium by Quontra Solutions
Tech talks (Automation on Selenium Web Driver. How to begin & implement)
Selenium Webdriver
Web application testing with Selenium
Selenium WebDriver training
Testing PHP with Codeception
Selenium WebDriver - Test automation for web applications
Selenium topic 1- Selenium Basic
Selenium- A Software Testing Tool
Selenium 2 - PyCon 2011
Selenium
Selenium interview Q&A
Selenium (1)
Acceptance testing in php with Codeception - Techmeetup Edinburgh
Ad

Viewers also liked (20)

PDF
Technical Debt 101
PDF
Managing technical debt
PPTX
An overview of selenium webdriver
PDF
Introduction to Robot Framework
PPTX
Identifying and Managing Technical Debt
PPTX
Selenium WebDriver
PDF
JavaCro'14 - Test Automation using RobotFramework Libraries – Stojan Peshov
PDF
Technical Debt: Do Not Underestimate The Danger
PDF
Clean code
PPTX
Introduction to Selenium Web Driver
PPT
Selenium ppt
PDF
Launch of The Little Prince Animated Series in Latin America - Final Report. ...
PPT
HISTÒRIA DEL POP-ROCK (50s i 60s)
PDF
Is 100 the New 60? Living Longer, Living Better. What's on the Horizon?
PPTX
Internet raffaella valluzzi
PDF
Concorrencia geral UFPE 2014
PPTX
Digital Capability - Designing your digital future by developing a digital ro...
PPT
fondo grada alta
PPTX
Classon halmet
PPTX
Data storage is in everyone's mind! Is it Yours?
Technical Debt 101
Managing technical debt
An overview of selenium webdriver
Introduction to Robot Framework
Identifying and Managing Technical Debt
Selenium WebDriver
JavaCro'14 - Test Automation using RobotFramework Libraries – Stojan Peshov
Technical Debt: Do Not Underestimate The Danger
Clean code
Introduction to Selenium Web Driver
Selenium ppt
Launch of The Little Prince Animated Series in Latin America - Final Report. ...
HISTÒRIA DEL POP-ROCK (50s i 60s)
Is 100 the New 60? Living Longer, Living Better. What's on the Horizon?
Internet raffaella valluzzi
Concorrencia geral UFPE 2014
Digital Capability - Designing your digital future by developing a digital ro...
fondo grada alta
Classon halmet
Data storage is in everyone's mind! Is it Yours?
Ad

Similar to Continuous Quality Assurance using Selenium WebDriver (20)

PDF
Magento Testing on all fronts
PDF
Rock-solid Magento Deployments (and Development)
PDF
Continuous Integration and Deployment Patterns for Magento
PDF
Rock-solid Magento Development and Deployment Workflows
PPTX
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
ODP
MySQL Monitoring Shoot Out
PPTX
STAREAST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
PPTX
Nodeflux : A Distributed Computation Platform
PDF
How to Build a Pure Evil Magento Module
PPTX
Designing Self-maintaining UI Tests for Web Applications
PDF
Zepplin_Pronko_Magento_Festival Hall 1_Final
PDF
PyCon 9: Continuous Delivery starts at your Development Dnvironment
KEY
JavaScript Testing VIA Selenium
PDF
Continuous Deployment Pipeline for Systems at Cascadia IT Conference - 2017-0...
PDF
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
PDF
Strangling the Monolith With a Data-Driven Approach: A Case Study
PDF
The Continuous delivery Value @ codemotion 2014
PDF
The Continuous delivery value - Funaro
PDF
Web Test Automation Framework - IndicThreads Conference
KEY
Confoo
Magento Testing on all fronts
Rock-solid Magento Deployments (and Development)
Continuous Integration and Deployment Patterns for Magento
Rock-solid Magento Development and Deployment Workflows
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
MySQL Monitoring Shoot Out
STAREAST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
Nodeflux : A Distributed Computation Platform
How to Build a Pure Evil Magento Module
Designing Self-maintaining UI Tests for Web Applications
Zepplin_Pronko_Magento_Festival Hall 1_Final
PyCon 9: Continuous Delivery starts at your Development Dnvironment
JavaScript Testing VIA Selenium
Continuous Deployment Pipeline for Systems at Cascadia IT Conference - 2017-0...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Strangling the Monolith With a Data-Driven Approach: A Case Study
The Continuous delivery Value @ codemotion 2014
The Continuous delivery value - Funaro
Web Test Automation Framework - IndicThreads Conference
Confoo

More from AOE (20)

PDF
Multithreaded XML Import (San Francisco Magento Meetup)
 
PDF
rock-solid TYPO3 development with continuous integration and deployment
 
PDF
Agile Management - Best Practice Day der Deutschen Bahn am 17.10.2013
 
PDF
Magento Imagine 2013: Fabrizio Branca - Learning To Fly: How Angry Birds Reac...
 
PDF
SONY on TYPO3 - Rapid Global CMS Deployment
 
PDF
The typo3.org Relaunch Project
 
PDF
Cloud Deployment und (Auto)Scaling am Beispiel von Angrybird
 
PDF
Searchperience Indexierungspipeline
 
PDF
High Performance Multi-Server Magento in der Cloud
 
PDF
Selenium 2 for PHP(Unit)
 
PDF
Angrybirds Magento Cloud Deployment
 
PDF
T3DD12 Caching with Varnish
 
PDF
T3DD12 community extension
 
PDF
Performance measurement and tuning
 
PDF
Domain Driven Design
 
PDF
Debugging, Monitoring and Profiling in TYPO3
 
PDF
Panasonic search
 
PDF
Performance durch Caching
 
PDF
Performance durch Caching
 
PPT
Open Source CMS TYPO3 at Cisco WebEx
 
Multithreaded XML Import (San Francisco Magento Meetup)
 
rock-solid TYPO3 development with continuous integration and deployment
 
Agile Management - Best Practice Day der Deutschen Bahn am 17.10.2013
 
Magento Imagine 2013: Fabrizio Branca - Learning To Fly: How Angry Birds Reac...
 
SONY on TYPO3 - Rapid Global CMS Deployment
 
The typo3.org Relaunch Project
 
Cloud Deployment und (Auto)Scaling am Beispiel von Angrybird
 
Searchperience Indexierungspipeline
 
High Performance Multi-Server Magento in der Cloud
 
Selenium 2 for PHP(Unit)
 
Angrybirds Magento Cloud Deployment
 
T3DD12 Caching with Varnish
 
T3DD12 community extension
 
Performance measurement and tuning
 
Domain Driven Design
 
Debugging, Monitoring and Profiling in TYPO3
 
Panasonic search
 
Performance durch Caching
 
Performance durch Caching
 
Open Source CMS TYPO3 at Cisco WebEx
 

Recently uploaded (20)

PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Machine learning based COVID-19 study performance prediction
PPT
Teaching material agriculture food technology
PDF
Empathic Computing: Creating Shared Understanding
PPTX
MYSQL Presentation for SQL database connectivity
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Encapsulation theory and applications.pdf
PPTX
Cloud computing and distributed systems.
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
cuic standard and advanced reporting.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Approach and Philosophy of On baking technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Digital-Transformation-Roadmap-for-Companies.pptx
The AUB Centre for AI in Media Proposal.docx
Encapsulation_ Review paper, used for researhc scholars
Machine learning based COVID-19 study performance prediction
Teaching material agriculture food technology
Empathic Computing: Creating Shared Understanding
MYSQL Presentation for SQL database connectivity
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Spectral efficient network and resource selection model in 5G networks
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Encapsulation theory and applications.pdf
Cloud computing and distributed systems.
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
NewMind AI Weekly Chronicles - August'25 Week I
cuic standard and advanced reporting.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Approach and Philosophy of On baking technology
Building Integrated photovoltaic BIPV_UPV.pdf

Continuous Quality Assurance using Selenium WebDriver

Editor's Notes

  • #59: track of singletons, allows rewrites.