1 | How to Select the Right Selenium Tools to Boost Your Test Automation perfecto.io
Mastering Cross-Browser Test Automation
With Cypress and Selenium
z
About Me:
Eran Kinsbruner
• Chief Evangelist and author at Perfecto
• Blogger and speaker
• 20+ years in development & testing
• Author of “The Digital Quality Handbook”
and “Continuous Testing for DevOps
Professionals”
• @ek121268
perfecto.io3 | Perfecto by Perforce © 2020 Perforce Software, Inc.
Today’s Agenda
1
2
3
Cross-Browser Testing Landscape Overview (Functional and NFT)
Introduction to the Cypress vs. Selenium
4 Testing Visibility Role
5 Live Demo and Q&A
Tool Comparison and Considerations
4 | How to Guarantee Continuous Value from your Test Automation perfecto.io
Cross Browser Testing Tools Landscape
perfecto.io5 | Perfecto by Perforce © 2020 Perforce Software, Inc.
Mobile Capabilities in Web Browser (Incomplete) — Ramping Up
CameraMic
Device Authentication
BT/BLE
Notification Network
perfecto.io6 | Perfecto by Perforce © 2020 Perforce Software, Inc.
Cross-Browser Testing Market Is Highly Fragmented
Codeless
Open
Source
perfecto.io7 | Perfecto by Perforce © 2020 Perforce Software, Inc.
Cross-Browser Testing Tools (Open-Source) — Download Trends Vary
Protractor
Puppeteer
WebDriver IO
Cypress IO
Selenium WebDriver
Source: npmtrends
perfecto.io8 | Perfecto by Perforce © 2020 Perforce Software, Inc.
Additional Categorization of JavaScript Browser Testing Tools
• Tools that...
• Provide a testing structure (BDD/ATDD) (Mocha, Jasmine, Jest, Cucumber).
• Provide assertion functions (Chai, Jasmine, Jest, Unexpected).
• Generate, display, and watch test results (Mocha, Jasmine, Jest, Karma).
• Generate code coverage reports (Istanbul, Jest, Blanket).
• Provide a browser or browser-like environment with control of scenario execution, UI testing, and more
(Protractor, Nightwatch, Phantom, Casper, Selenium, WebDriver.IO, TestCafe).
• Provide mocks, spies, and stubs (Sinon, Jasmine, enzyme, Jest, testdouble).
Source: Medium.com
perfecto.io9 | Perfecto by Perforce © 2020 Perforce Software, Inc.
Motivation
• Receive fast feedback (unit and basic functional tests)
— mostly dev.
• Easy environment setup, no IT dependencies.
• Uses standard JS language.
• Supported and promoted by browser vendors (Google, Mozilla).
• Additional use cases to cover:
• HAR file
• Performance testing
• Basic UI
• Security
Headless Browsers Role
perfecto.io10 | Perfecto by Perforce © 2020 Perforce Software, Inc.
z
Headless Browsers Role
perfecto.io11 | Perfecto by Perforce © 2020 Perforce Software, Inc.
Web Market Testing – Selection Criteria
Automation
Coverage
Visual navigation testing
Take screenshots
Network monitoring, HAR
file
Memory & performance
profiling
Code coverage analysis
Testing types
SDLC
Process Fit
Plugins/integrations
BDD/ATDD friendly
Dev language support
Automation
Robustness &
Maintainability
Config file generation
Page object model creation
Execution speed
Sync
Feedback Loop
& Reporting
Reporters
Community Strength
Documentation
Contributors
Cloud & Automation
at Scale
Cloud Support
perfecto.io12 | Perfecto by Perforce © 2020 Perforce Software, Inc.
Pipeline Testing Coverage Example
Spotlight – Cypress & Selenium
perfecto.io14 | Perfecto by Perforce © 2020 Perforce Software, Inc.
Market Adoption — Cypress
perfecto.io15 | Perfecto by Perforce © 2020 Perforce Software, Inc.
Cypress Overview
perfecto.io16 | Perfecto by Perforce © 2020 Perforce Software, Inc.
z
Cypress Overview –
Why It’s Dev Friendly
Fast, open source, & works
on any front-end
framework
Uses JavaScript – Matches
both SDTEs and devs
Time travel, real time reload,
run in CI
Documentation and ease of
use
perfecto.io17 | Perfecto by Perforce © 2020 Perforce Software, Inc.
Front-End Developer Friendly Testing
perfecto.io18 | Perfecto by Perforce © 2020 Perforce Software, Inc.
Cypress Execution Overview
Run From UI Run in the Cloud — Perfecto Run From CLI
perfecto.io19 | Perfecto by Perforce © 2020 Perforce Software, Inc.
Cypress Dashboard and Parallel Testing
perfecto.io20 | Perfecto by Perforce © 2020 Perforce Software, Inc.
• Standard W3C implementation for all WebDriver browsers
Selenium 4 Highlights
perfecto.io21 | Perfecto by Perforce © 2020 Perforce Software, Inc.
Selenium 4 Highlights — Continued
Blocking specific types
from being loaded — like
styles and images
• Relative locators • Interacting with Chrome
Debugging Protocol
support (CDP)
perfecto.io22 | Perfecto by Perforce © 2020 Perforce Software, Inc.
Cypress vs. Selenium
Selenium has its own IDE, new features like relative locators, and more
23 | How to Guarantee Continuous Value from your Test Automation perfecto.io
The End vs. the Or Approach
High-Level Comparison Between Tools and Practices
Test
Framework
Supported
Dev
Languages
Supported
Browsers
Supported Test
Frameworks
Setup and
Execution
Integrations Breadth of
Testing
Options
Maturity,
Documentation,
Support
Required Skillset Cloud and Execution at
Scale
Selenium
WebDriver
Java, C#, Java
Script,
Python,
Ruby,
Objective-C
Chrome,
Safari,
Firefox, Edge,
IE
Mocha JS, Jest,
other super set
on top of
Selenium
(Protractor,
WebDriverIO,
etc.
Download
relevant driver,
set up a grid,
network and
location
impacts
execution
speed
Plenty of
integrations
(CI, CD,
reporting,
visual testing,
cloud vendors)
End-to-
end,
security,
unit,
Robust community,
multiple bindings, best
practices
Coding skills required Perfecto fully supports
Selenium and its
WebDriver
configurations. Local
execution requires
setting up a Selenium
grid
Cypress.io JavaScript Chrome,
Electron
Mocha JS Comes with
bundled
chrome
browser, no
complex
environment
setup
Limited
integrations
End-to-
end
Good documentation
and code sample,
growing community
Coding skills required Built-in Chrome
browser, limited
Codeless Irrelevant,
based on
record and
playback
All Proprietary UI
with underlying
Selenium
WebDriver APIs
Mostly
SaaS/browser
plugin
installation
Limited Functional
/UI
Growing, limited No coding skills
required
Perfecto supports
codeless in the cloud
BDD Java, Ruby,
JS, Kotlin
All Junit, Selenium,
Appium
Open-Source,
Maven/Gradle/
TestNG
Plenty + APIs
(e.g. Rest
Assured)
Functional Robust community,
docs, adoption
Step-definition
development in code is
required/scenarios are
no-code
Perfecto Quantum is a
web/mobile BDD
framework
25 | How to Guarantee Continuous Value from your Test Automation perfecto.io
Test Data Visibility Role
perfecto.io26 | Perfecto by Perforce © 2020 Perforce Software, Inc.
The Power of Test Data Analysis
Ask yourself:
1. Is there a long history of
failures:
A. Test flakiness
B. Exclude and debug
2. Are we following script
development practices to
avoid:
A. Popup/security issues
B. Element not found
C. Platform-specific issues
3. Do the tests bring any new
value?
4. Platform/CI health?
perfecto.io27 | Perfecto by Perforce © 2020 Perforce Software, Inc.
Collaborative Approach — Codeless & Code-Based
perfecto.io28 | Perfecto by Perforce © 2020 Perforce Software, Inc.
LIVE DEMO
• Selenium BDD across platforms running in parallel
• Cypress framework
L I V E D E M O
29 | Getting Ready for iOS 13 Testing perfecto.io
Perfecto’s Four Key Pillars for Continuous Testing
perfecto.io30 | Perfecto by Perforce © 2020 Perforce Software, Inc.
The Four Key Pillars of Continuous Testing in DevOps
ANALYSISCREATION EXECUTION LAB
Unified solution serves DevOps with greater efficiency.
Lab for continuous testing
• Backbone for all testing
activities
• Hosting of devices,
management, & logistics
• Availability & scaling
• Supporting functions
Test execution within the
pipeline
• Scale
• Orchestration
• Frameworks
Test creation and
maintenance
• Authoring tool
• Validations
Test analysis
• Fast feedback
• Root cause analysis
Perfecto’s Smart Continuous Testing Solution
Smart Execution
Fast and parallel test execution with
multi-team orchestration abilities and
management.
Smart Analytics
"Single pane of glass" provides
visibility and scales to support
millions of test results.
Smart Creation
Automation creation that matches your
team’s skillset (Appium, Espresso,
XCUITest, Quantum BDD, Codeless).
Smart Lab
Always on and stable. Always up
to date. Supports all mobile OS
and platforms.
The Perfecto
human factor
increases your
chances to succeed.
Black Belt
Testing Experts
Training
Dedicated
Success Manager
24/7 VIP
Support
perfecto.io32 | Perfecto by Perforce © 2020 Perforce Software, Inc.
33 | Getting Ready for iOS 13 Testing perfecto.io
Thank You
Visit perfecto.io or follow us @perfectomobile

Mastering Cross-Browser Test Automation With Cypress and Selenium

  • 1.
    1 | Howto Select the Right Selenium Tools to Boost Your Test Automation perfecto.io Mastering Cross-Browser Test Automation With Cypress and Selenium
  • 2.
    z About Me: Eran Kinsbruner •Chief Evangelist and author at Perfecto • Blogger and speaker • 20+ years in development & testing • Author of “The Digital Quality Handbook” and “Continuous Testing for DevOps Professionals” • @ek121268
  • 3.
    perfecto.io3 | Perfectoby Perforce © 2020 Perforce Software, Inc. Today’s Agenda 1 2 3 Cross-Browser Testing Landscape Overview (Functional and NFT) Introduction to the Cypress vs. Selenium 4 Testing Visibility Role 5 Live Demo and Q&A Tool Comparison and Considerations
  • 4.
    4 | Howto Guarantee Continuous Value from your Test Automation perfecto.io Cross Browser Testing Tools Landscape
  • 5.
    perfecto.io5 | Perfectoby Perforce © 2020 Perforce Software, Inc. Mobile Capabilities in Web Browser (Incomplete) — Ramping Up CameraMic Device Authentication BT/BLE Notification Network
  • 6.
    perfecto.io6 | Perfectoby Perforce © 2020 Perforce Software, Inc. Cross-Browser Testing Market Is Highly Fragmented Codeless Open Source
  • 7.
    perfecto.io7 | Perfectoby Perforce © 2020 Perforce Software, Inc. Cross-Browser Testing Tools (Open-Source) — Download Trends Vary Protractor Puppeteer WebDriver IO Cypress IO Selenium WebDriver Source: npmtrends
  • 8.
    perfecto.io8 | Perfectoby Perforce © 2020 Perforce Software, Inc. Additional Categorization of JavaScript Browser Testing Tools • Tools that... • Provide a testing structure (BDD/ATDD) (Mocha, Jasmine, Jest, Cucumber). • Provide assertion functions (Chai, Jasmine, Jest, Unexpected). • Generate, display, and watch test results (Mocha, Jasmine, Jest, Karma). • Generate code coverage reports (Istanbul, Jest, Blanket). • Provide a browser or browser-like environment with control of scenario execution, UI testing, and more (Protractor, Nightwatch, Phantom, Casper, Selenium, WebDriver.IO, TestCafe). • Provide mocks, spies, and stubs (Sinon, Jasmine, enzyme, Jest, testdouble). Source: Medium.com
  • 9.
    perfecto.io9 | Perfectoby Perforce © 2020 Perforce Software, Inc. Motivation • Receive fast feedback (unit and basic functional tests) — mostly dev. • Easy environment setup, no IT dependencies. • Uses standard JS language. • Supported and promoted by browser vendors (Google, Mozilla). • Additional use cases to cover: • HAR file • Performance testing • Basic UI • Security Headless Browsers Role
  • 10.
    perfecto.io10 | Perfectoby Perforce © 2020 Perforce Software, Inc. z Headless Browsers Role
  • 11.
    perfecto.io11 | Perfectoby Perforce © 2020 Perforce Software, Inc. Web Market Testing – Selection Criteria Automation Coverage Visual navigation testing Take screenshots Network monitoring, HAR file Memory & performance profiling Code coverage analysis Testing types SDLC Process Fit Plugins/integrations BDD/ATDD friendly Dev language support Automation Robustness & Maintainability Config file generation Page object model creation Execution speed Sync Feedback Loop & Reporting Reporters Community Strength Documentation Contributors Cloud & Automation at Scale Cloud Support
  • 12.
    perfecto.io12 | Perfectoby Perforce © 2020 Perforce Software, Inc. Pipeline Testing Coverage Example
  • 13.
  • 14.
    perfecto.io14 | Perfectoby Perforce © 2020 Perforce Software, Inc. Market Adoption — Cypress
  • 15.
    perfecto.io15 | Perfectoby Perforce © 2020 Perforce Software, Inc. Cypress Overview
  • 16.
    perfecto.io16 | Perfectoby Perforce © 2020 Perforce Software, Inc. z Cypress Overview – Why It’s Dev Friendly Fast, open source, & works on any front-end framework Uses JavaScript – Matches both SDTEs and devs Time travel, real time reload, run in CI Documentation and ease of use
  • 17.
    perfecto.io17 | Perfectoby Perforce © 2020 Perforce Software, Inc. Front-End Developer Friendly Testing
  • 18.
    perfecto.io18 | Perfectoby Perforce © 2020 Perforce Software, Inc. Cypress Execution Overview Run From UI Run in the Cloud — Perfecto Run From CLI
  • 19.
    perfecto.io19 | Perfectoby Perforce © 2020 Perforce Software, Inc. Cypress Dashboard and Parallel Testing
  • 20.
    perfecto.io20 | Perfectoby Perforce © 2020 Perforce Software, Inc. • Standard W3C implementation for all WebDriver browsers Selenium 4 Highlights
  • 21.
    perfecto.io21 | Perfectoby Perforce © 2020 Perforce Software, Inc. Selenium 4 Highlights — Continued Blocking specific types from being loaded — like styles and images • Relative locators • Interacting with Chrome Debugging Protocol support (CDP)
  • 22.
    perfecto.io22 | Perfectoby Perforce © 2020 Perforce Software, Inc. Cypress vs. Selenium Selenium has its own IDE, new features like relative locators, and more
  • 23.
    23 | Howto Guarantee Continuous Value from your Test Automation perfecto.io The End vs. the Or Approach
  • 24.
    High-Level Comparison BetweenTools and Practices Test Framework Supported Dev Languages Supported Browsers Supported Test Frameworks Setup and Execution Integrations Breadth of Testing Options Maturity, Documentation, Support Required Skillset Cloud and Execution at Scale Selenium WebDriver Java, C#, Java Script, Python, Ruby, Objective-C Chrome, Safari, Firefox, Edge, IE Mocha JS, Jest, other super set on top of Selenium (Protractor, WebDriverIO, etc. Download relevant driver, set up a grid, network and location impacts execution speed Plenty of integrations (CI, CD, reporting, visual testing, cloud vendors) End-to- end, security, unit, Robust community, multiple bindings, best practices Coding skills required Perfecto fully supports Selenium and its WebDriver configurations. Local execution requires setting up a Selenium grid Cypress.io JavaScript Chrome, Electron Mocha JS Comes with bundled chrome browser, no complex environment setup Limited integrations End-to- end Good documentation and code sample, growing community Coding skills required Built-in Chrome browser, limited Codeless Irrelevant, based on record and playback All Proprietary UI with underlying Selenium WebDriver APIs Mostly SaaS/browser plugin installation Limited Functional /UI Growing, limited No coding skills required Perfecto supports codeless in the cloud BDD Java, Ruby, JS, Kotlin All Junit, Selenium, Appium Open-Source, Maven/Gradle/ TestNG Plenty + APIs (e.g. Rest Assured) Functional Robust community, docs, adoption Step-definition development in code is required/scenarios are no-code Perfecto Quantum is a web/mobile BDD framework
  • 25.
    25 | Howto Guarantee Continuous Value from your Test Automation perfecto.io Test Data Visibility Role
  • 26.
    perfecto.io26 | Perfectoby Perforce © 2020 Perforce Software, Inc. The Power of Test Data Analysis Ask yourself: 1. Is there a long history of failures: A. Test flakiness B. Exclude and debug 2. Are we following script development practices to avoid: A. Popup/security issues B. Element not found C. Platform-specific issues 3. Do the tests bring any new value? 4. Platform/CI health?
  • 27.
    perfecto.io27 | Perfectoby Perforce © 2020 Perforce Software, Inc. Collaborative Approach — Codeless & Code-Based
  • 28.
    perfecto.io28 | Perfectoby Perforce © 2020 Perforce Software, Inc. LIVE DEMO • Selenium BDD across platforms running in parallel • Cypress framework L I V E D E M O
  • 29.
    29 | GettingReady for iOS 13 Testing perfecto.io Perfecto’s Four Key Pillars for Continuous Testing
  • 30.
    perfecto.io30 | Perfectoby Perforce © 2020 Perforce Software, Inc. The Four Key Pillars of Continuous Testing in DevOps ANALYSISCREATION EXECUTION LAB Unified solution serves DevOps with greater efficiency. Lab for continuous testing • Backbone for all testing activities • Hosting of devices, management, & logistics • Availability & scaling • Supporting functions Test execution within the pipeline • Scale • Orchestration • Frameworks Test creation and maintenance • Authoring tool • Validations Test analysis • Fast feedback • Root cause analysis
  • 31.
    Perfecto’s Smart ContinuousTesting Solution Smart Execution Fast and parallel test execution with multi-team orchestration abilities and management. Smart Analytics "Single pane of glass" provides visibility and scales to support millions of test results. Smart Creation Automation creation that matches your team’s skillset (Appium, Espresso, XCUITest, Quantum BDD, Codeless). Smart Lab Always on and stable. Always up to date. Supports all mobile OS and platforms. The Perfecto human factor increases your chances to succeed. Black Belt Testing Experts Training Dedicated Success Manager 24/7 VIP Support
  • 32.
    perfecto.io32 | Perfectoby Perforce © 2020 Perforce Software, Inc.
  • 33.
    33 | GettingReady for iOS 13 Testing perfecto.io Thank You Visit perfecto.io or follow us @perfectomobile