SlideShare a Scribd company logo
Selenium at
Salesforce Scale
David Louvton
Lead Engineer
dlouvton@salesforce.com
Sagar Wanaselja
Lead Engineer
Salesforce selenium-saucelabs-webinar-april-2014
• About Salesforce engineering
• Operating a selenium farm
• Selenium design patterns
• Overcoming test failures
• Q&A
Agenda
Salesforce Scale
• 3:2 ratio for developers : quality engineers
• everyone is a software engineer; role varies
• selenium committers on staff (Jim Evans, Luke Inman)
• Data centers with thousands of VMs for automation
• multimillion dollar investment
• using vmware (VShere), OpenStack and EC2
• 500 commits per day
• ~120 software engineering teams
Why Salesforce loves WebDriver
WebDriver is the only test framework in our current
arsenal that truly mimics an end-user’s experience
• We don’t mock anything
• We test against a live app
• We suffer the pain of latency
• We test end to end on almost every action
WebDriver tests can catch things other levels of tests
can’t
• Multi-platform consistency
• DOM consistency
• Rendering issues
• Catching inconsistency between
app layers
source: watirmelon.com © Alister Scott
UI Testing Portfolio
• 50,000 unique Selenium tests
• 7,500 unique WebDriver tests
• full “browser compatibility”: IE6-IE11, Firefox, Chrome, Safari
• some can run in headless browser like Phantom JS
• 2,000 javascript unit tests
• no DOM required
• 10ms average execution time
source: watirmelon.com © Alister Scott
1,000,000 browser tests per day
• Click here to add bullets
The Selenium Infrastructure
● Automatically creating, assigning, closing and reopening
bug reports for test failures and flapping tests .
● Test jobs must meet failure thresholds (99%+). Code
lines are locked for teams under thresholds
● Support for all combinations of OS & Browser using
portable VM Templates, creating deterministic and identical
test environments
Salesforce selenium-saucelabs-webinar-april-2014
Issues of scale
• Assigning test failures to the responsible engineer
• Non deterministic tests (flappers) and re-runs
• Selenium jar upgrades are challenging
• Browser upgrades are challenging
• IT and automation ops provide different versions
• Large suites: adjust run frequency, deprecate old tests
Salesforce UI Testing Pattern
• Click here to add bullets
Proper Page Objects Encapsulate Selenium
• Make an API of your page for your test
• No imports for “openqa” or “selenium.org” in your test
• All references to driver & selenium in the page object
• Fail fast - call the page object factory in test setup
• No assertions in page objects (or any test utility)
• Share page objects across engineering teams
• developer complete UI should have a page object
• if you can’t make one it’s not a testable page
• dependency challenges at scale
Challenges for Mobile Platforms
• Adapting page objects to platform specific UI elements
• Screen sizes and adaptive layouts
• “stage left” - switching into contained apps
• lightweight page objects = widgets
• Avoid browser or platform specific code in actual tests
• establish context elsewhere in utils or page objects
• Automated tests in emulators (99%+)
• manual tests on devices before release
• exception: testing video
Sagar Wanaselja
Lead Engineer
swanaselja@salesforce.com
Problematic WebDriver Test
Better WebDriver Test
PageObject WebDriver Test
Diagnosing Test Failures
• Screenshot and HTML capture at failure point
• AssertionError or RuntimeException
• Differences between localhost and automation VM
• Optimistic timing assumptions
• javascript, rendering, server response, etc.
• Defensive “negative” testing
• Getting to 100% tests passing
Pro Tips
• Version tests and app code (and configuration) together
• Use the Page Object model
• Use the API to set up the test, not the UI
• Anticipate Selenium and Browser releases
• Allocate capacity to browsers most used by customers
• log the user agent on every page view
More Pro Tips
• Avoid using xpath selectors
• Complex DOM makes xpath evaluation much slower
• Some xpaths are not properly evaluated in WebDriver
• When working with popups make sure you return focus
to the main window
• For static/simple HTML pages consider the
HtmlUnitDriver
Salesforce selenium-saucelabs-webinar-april-2014
Mature Quality Strategies
• Selenium for dynamic security vulnerability analysis
• Pixel perfect image diffs
• Accessibility testing (tab completion)
• Testing javascript with unit tests
• Selenium is for testing browser compatibility and DOM

More Related Content

PDF
Selenium at Salesforce Scale
PPT
Test automation process
PDF
Test Automation Framework Design | www.idexcel.com
PPT
Automation testing strategy, approach & planning
PDF
Salesforce testing best_practices
PPS
Final Automation Testing
PPT
Demo1ghjkl
PPTX
Selenium RC, Selenium WebDriver and HP LoadRunner
Selenium at Salesforce Scale
Test automation process
Test Automation Framework Design | www.idexcel.com
Automation testing strategy, approach & planning
Salesforce testing best_practices
Final Automation Testing
Demo1ghjkl
Selenium RC, Selenium WebDriver and HP LoadRunner

What's hot (20)

PDF
A Story of Continuous Integration
PPTX
Top 20 best automation testing tools
PPT
Testwarez 2009 Use Proper Tool
PPTX
Automation Tools Overview
PPT
Test Automation Best Practices (with SOA test approach)
PDF
WSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
PPT
Testing Frameworks
PDF
Test Automation
PPTX
Silk Performer Presentation v1
PPTX
Start Your Automation Journey With Rapise
PPT
Test Automation Framework Designs
PPSX
Automation Framework 042009 V2
PPTX
Test Automation Frameworks: Assumptions, Concepts & Tools
PPT
Programming skills for test automation
PPTX
Test Automation
PPT
Test automation principles, terminologies and implementations
PPT
Designing a Test Automation Framework By Quontra solutions
PPTX
Selenium Tutorial for Beginners | Automation framework Basics
PPTX
Software test automation_overview
PPT
Automated Testing with Agile
A Story of Continuous Integration
Top 20 best automation testing tools
Testwarez 2009 Use Proper Tool
Automation Tools Overview
Test Automation Best Practices (with SOA test approach)
WSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
Testing Frameworks
Test Automation
Silk Performer Presentation v1
Start Your Automation Journey With Rapise
Test Automation Framework Designs
Automation Framework 042009 V2
Test Automation Frameworks: Assumptions, Concepts & Tools
Programming skills for test automation
Test Automation
Test automation principles, terminologies and implementations
Designing a Test Automation Framework By Quontra solutions
Selenium Tutorial for Beginners | Automation framework Basics
Software test automation_overview
Automated Testing with Agile
Ad

Viewers also liked (11)

PDF
selenium meetup sf talk march 2014 Selenium at Scale
PPT
Яхина Р. Р
PDF
Performance Measurement and Monitoring for Salesforce Web & Mobile Apps
PPTX
Bdd with Cucumber and Mocha
PPT
Test Automation With Cucumber JVM, Selenium, and Mocha
PDF
Testing Salesforce at Cloud Scale
PDF
Selenium Tips & Tricks
PPTX
Agile scrum roles
DOCX
Salesforce Testing Resume
PDF
Performance Monitoring and Testing in the Salesforce Cloud
PDF
Best Practices for Testing in salesforce.com
selenium meetup sf talk march 2014 Selenium at Scale
Яхина Р. Р
Performance Measurement and Monitoring for Salesforce Web & Mobile Apps
Bdd with Cucumber and Mocha
Test Automation With Cucumber JVM, Selenium, and Mocha
Testing Salesforce at Cloud Scale
Selenium Tips & Tricks
Agile scrum roles
Salesforce Testing Resume
Performance Monitoring and Testing in the Salesforce Cloud
Best Practices for Testing in salesforce.com
Ad

Similar to Salesforce selenium-saucelabs-webinar-april-2014 (20)

PPTX
Web Automation Testing for developers?
PPTX
Best java automation training institute in Bangalore - Selenium Labs
PPTX
SenchaCon 2016: The Changing Landscape of JavaScript Testing - Joel Watson an...
PPTX
Introduction to selenium
DOC
Resume_Sivasankaraiah Poli
PDF
Patterns and practices for building enterprise-scale HTML5 apps
PPTX
Udvid din test portefølje med coded ui test og cloud load test
PPTX
QAorHighway2016
PDF
Escaping Test Hell - ACCU 2014
PDF
[webinar] Cutting-edge Functional UI Testing Techniques - w/ Adam Carmi
PPTX
AUTOMATION FRAMEWORK USING SELENIUM & TESTNG ALONG WITH MAVEN
DOCX
Software Testing Tools Training
PPTX
Cross browser Testing JavaScript
PDF
Testing Angular
PDF
An Automation Culture: The Key to Agile Success
PPTX
Hacker Proof web app using Functional tests
PPTX
Automated Testing using JavaScript
PPTX
Automated ui-testing
PPTX
Selenium And Its Types
PPT
Selenium Concepts
Web Automation Testing for developers?
Best java automation training institute in Bangalore - Selenium Labs
SenchaCon 2016: The Changing Landscape of JavaScript Testing - Joel Watson an...
Introduction to selenium
Resume_Sivasankaraiah Poli
Patterns and practices for building enterprise-scale HTML5 apps
Udvid din test portefølje med coded ui test og cloud load test
QAorHighway2016
Escaping Test Hell - ACCU 2014
[webinar] Cutting-edge Functional UI Testing Techniques - w/ Adam Carmi
AUTOMATION FRAMEWORK USING SELENIUM & TESTNG ALONG WITH MAVEN
Software Testing Tools Training
Cross browser Testing JavaScript
Testing Angular
An Automation Culture: The Key to Agile Success
Hacker Proof web app using Functional tests
Automated Testing using JavaScript
Automated ui-testing
Selenium And Its Types
Selenium Concepts

More from Sauce Labs (20)

PDF
Simplify Salesforce Testing with AI-Driven Codeless Tools
PDF
Testing on Mobile Devices with Location Services
PDF
Your Framework for Success: introduction to JavaScript Testing at Scale
PDF
Automating Hybrid Applications with Appium
PDF
Quality at Speed: More API Testing, Less UI Testing
PPTX
Creating Digital Confidence with Test Automation
PDF
Just Enough (Automated) Testing
PDF
Using Axe to Add Accessibility Checks to Your Existing Selenium Tests
PDF
How Open Source Helps to Bring Back Product Obsession
PDF
Webinar: A Sneak Peek at Selenium 4 with Simon Stewart
PDF
[Deu] Test Automatisierung Mit Web Driver.io
PDF
Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...
PDF
Accelerating Your Digital Agenda with Continuous Testing ft. Forrester
PDF
How to Measure Success in Continuous Testing
PDF
From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...
PDF
5 Steps to Jump Start Your Test Automation
PDF
Sauce Labs Webinar: Rising Importance of Software Testing
PDF
BDD With Selenide by Hima Bindu Peteti
PDF
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
PDF
Continuous Delivery for "Mature" Codebases by Melisa Benua
Simplify Salesforce Testing with AI-Driven Codeless Tools
Testing on Mobile Devices with Location Services
Your Framework for Success: introduction to JavaScript Testing at Scale
Automating Hybrid Applications with Appium
Quality at Speed: More API Testing, Less UI Testing
Creating Digital Confidence with Test Automation
Just Enough (Automated) Testing
Using Axe to Add Accessibility Checks to Your Existing Selenium Tests
How Open Source Helps to Bring Back Product Obsession
Webinar: A Sneak Peek at Selenium 4 with Simon Stewart
[Deu] Test Automatisierung Mit Web Driver.io
Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...
Accelerating Your Digital Agenda with Continuous Testing ft. Forrester
How to Measure Success in Continuous Testing
From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...
5 Steps to Jump Start Your Test Automation
Sauce Labs Webinar: Rising Importance of Software Testing
BDD With Selenide by Hima Bindu Peteti
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
Continuous Delivery for "Mature" Codebases by Melisa Benua

Recently uploaded (20)

PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Unlocking AI with Model Context Protocol (MCP)
DOCX
The AUB Centre for AI in Media Proposal.docx
PPT
Teaching material agriculture food technology
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Electronic commerce courselecture one. Pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Approach and Philosophy of On baking technology
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Machine learning based COVID-19 study performance prediction
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
KodekX | Application Modernization Development
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
MIND Revenue Release Quarter 2 2025 Press Release
Programs and apps: productivity, graphics, security and other tools
The Rise and Fall of 3GPP – Time for a Sabbatical?
Per capita expenditure prediction using model stacking based on satellite ima...
Unlocking AI with Model Context Protocol (MCP)
The AUB Centre for AI in Media Proposal.docx
Teaching material agriculture food technology
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Reach Out and Touch Someone: Haptics and Empathic Computing
Electronic commerce courselecture one. Pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
NewMind AI Weekly Chronicles - August'25 Week I
Approach and Philosophy of On baking technology
MYSQL Presentation for SQL database connectivity
Machine learning based COVID-19 study performance prediction
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
KodekX | Application Modernization Development
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx

Salesforce selenium-saucelabs-webinar-april-2014

  • 1. Selenium at Salesforce Scale David Louvton Lead Engineer dlouvton@salesforce.com Sagar Wanaselja Lead Engineer
  • 3. • About Salesforce engineering • Operating a selenium farm • Selenium design patterns • Overcoming test failures • Q&A Agenda
  • 4. Salesforce Scale • 3:2 ratio for developers : quality engineers • everyone is a software engineer; role varies • selenium committers on staff (Jim Evans, Luke Inman) • Data centers with thousands of VMs for automation • multimillion dollar investment • using vmware (VShere), OpenStack and EC2 • 500 commits per day • ~120 software engineering teams
  • 5. Why Salesforce loves WebDriver WebDriver is the only test framework in our current arsenal that truly mimics an end-user’s experience • We don’t mock anything • We test against a live app • We suffer the pain of latency • We test end to end on almost every action WebDriver tests can catch things other levels of tests can’t • Multi-platform consistency • DOM consistency • Rendering issues • Catching inconsistency between app layers source: watirmelon.com © Alister Scott
  • 6. UI Testing Portfolio • 50,000 unique Selenium tests • 7,500 unique WebDriver tests • full “browser compatibility”: IE6-IE11, Firefox, Chrome, Safari • some can run in headless browser like Phantom JS • 2,000 javascript unit tests • no DOM required • 10ms average execution time source: watirmelon.com © Alister Scott
  • 7. 1,000,000 browser tests per day • Click here to add bullets
  • 8. The Selenium Infrastructure ● Automatically creating, assigning, closing and reopening bug reports for test failures and flapping tests . ● Test jobs must meet failure thresholds (99%+). Code lines are locked for teams under thresholds ● Support for all combinations of OS & Browser using portable VM Templates, creating deterministic and identical test environments
  • 10. Issues of scale • Assigning test failures to the responsible engineer • Non deterministic tests (flappers) and re-runs • Selenium jar upgrades are challenging • Browser upgrades are challenging • IT and automation ops provide different versions • Large suites: adjust run frequency, deprecate old tests
  • 11. Salesforce UI Testing Pattern • Click here to add bullets
  • 12. Proper Page Objects Encapsulate Selenium • Make an API of your page for your test • No imports for “openqa” or “selenium.org” in your test • All references to driver & selenium in the page object • Fail fast - call the page object factory in test setup • No assertions in page objects (or any test utility) • Share page objects across engineering teams • developer complete UI should have a page object • if you can’t make one it’s not a testable page • dependency challenges at scale
  • 13. Challenges for Mobile Platforms • Adapting page objects to platform specific UI elements • Screen sizes and adaptive layouts • “stage left” - switching into contained apps • lightweight page objects = widgets • Avoid browser or platform specific code in actual tests • establish context elsewhere in utils or page objects • Automated tests in emulators (99%+) • manual tests on devices before release • exception: testing video
  • 18. Diagnosing Test Failures • Screenshot and HTML capture at failure point • AssertionError or RuntimeException • Differences between localhost and automation VM • Optimistic timing assumptions • javascript, rendering, server response, etc. • Defensive “negative” testing • Getting to 100% tests passing
  • 19. Pro Tips • Version tests and app code (and configuration) together • Use the Page Object model • Use the API to set up the test, not the UI • Anticipate Selenium and Browser releases • Allocate capacity to browsers most used by customers • log the user agent on every page view
  • 20. More Pro Tips • Avoid using xpath selectors • Complex DOM makes xpath evaluation much slower • Some xpaths are not properly evaluated in WebDriver • When working with popups make sure you return focus to the main window • For static/simple HTML pages consider the HtmlUnitDriver
  • 22. Mature Quality Strategies • Selenium for dynamic security vulnerability analysis • Pixel perfect image diffs • Accessibility testing (tab completion) • Testing javascript with unit tests • Selenium is for testing browser compatibility and DOM