SlideShare a Scribd company logo
BT12
Test Automation
11/17/2016 3:00:00 PM
Build Fail-Proof Tests in Any Browser
with Selenium
Presented by:
Kevin Berg
Sauce Labs
Brought to you by:
350 Corporate Way, Suite 400, Orange Park, FL 32073
888--‐268--‐8770 ·∙ 904--‐278--‐0524 - info@techwell.com - http://www.stareast.techwell.com/
Kevin Berg
Sauce Labs
Kevin Berg is a customer automation specialist at Sauce Labs where he works
with prospective, new, and existing customers to adapt their tests and
frameworks to enhance their parallel and cross browser testing capabilities. Kevin
has written test framework examples that exhibit both parallel execution and
cross browser testing capability for desktop and mobile platforms. As a
proponent of open source materials, these examples are publicly available on
GitHub (@KevinMarkVI). A classical musician turned software engineer, Kevin
enjoys watching sports, playing video games, and spending time outdoors with
his wife and dog.
11/1/2016
1
Fail Proof Tests in Any BrowserFail Proof Tests in Any Browser
with Seleniumwith Seleniumwith Seleniumwith Selenium
K E V I N B E R G , C U S T O M E R A U T O M AT I O N
S P E C I A L I S T
Kevin Berg
A little about me:
D r. K e v i n B e r g , D M A
• Help customers transition from running test manually or on local
Selenium grids, to parallel cross-browser testing in the cloud
• Write custom testing frameworks, features, and Selenium scripts
• Selenium/Appium workshops and training
• CI/CD architecture and integrationCI/CD architecture and integration
© Sauce Labs, Inc. 2
11/1/2016
2
Agenda
• Selenium – Quick Overview
• The Problem Statement
• Why Cross Browser Testing is Important
• The Actual Problem(s)
• The Solutions
• Questions
• More Questions? Come by the Sauce Labs booth!
© Sauce Labs, Inc. 3
Selenium – Quick Overview
Browser Automation Framework:
• Open source
• Used mainly for testing purposes
• Automates all the most popular browsers
• Selenium can replicate nearly any user interaction with the
browser
• Bindings to all the most commonly use programming languages
• Natural language commands make it simple to start writing tests
© Sauce Labs, Inc. 4
11/1/2016
3
Automating with Selenium
browser
• get(“www myWebsite com”);• .get( www.myWebsite.com );
• .findElement();
• .click();
• .submit();
• .sendKeys();
• .isDisplayed();
© Sauce Labs, Inc. 5
The Problem
The Usual Story
1. Selenium tests are written in Firefox
2. Tests Pass!
3. Run Same tests in Internet Explorer
4. Tests Fail!
5. Anger
What is Happening?
© Sauce Labs, Inc. 6
11/1/2016
4
Our Problem is Actually Two Problems
Browsers
• They are not all the same
Browser Automation Drivers
• Also not the same
© Sauce Labs, Inc. 7
Browsers
11/1/2016
5
Why Firefox?
• Came out of the box with Selenium
• WebDriver driver = new FirefoxDriver();
• Up to Firefox version 47
• Selenium IDE Firefox Plugin
• Open Source
• Dotted lines
Firefox
Chrome
© Sauce Labs, Inc. 9
Chrome
Browsers
Each browser uses a different rendering (or layout) engine:
• WebKit (Safari and iOS)WebKit (Safari and iOS)
• Blink (Chrome, Opera)
• Gecko (Firefox)
• Trident (Internet Explorer)
• EdgeHTML (Microsoft Edge)
HTML and CSS:
• Complex with new features being added and others depreciated
• Errors handled differently
Can lead to elements being covered or not visible.
© Sauce Labs, Inc. 10
11/1/2016
6
Browser Timing Issues
Some rendering engines are faster than others
• Chrome (Fast)
• Internet Explorer (Not as fast… )
AJAX Requests
• DOM is accessed with JavaScript to dynamically display the
information presented
© Sauce Labs, Inc. 11
Drivers
11/1/2016
7
Browser Automation Drivers
Each Browser has its own Native Automation Support
• Firefox Marionette• Firefox - Marionette
• Version 48 moved from FirefoxDriver to Marionette
• Many Selenium methods still being implemented
• https://developer.mozilla.org/en-
US/docs/Mozilla/QA/Marionette/WebDriver/status
© Sauce Labs, Inc. 13
Browser Automation Drivers - Continued
• Internet Explorer
• Issues with Actions Library
• moveTo
• hover
• Safari
• Recently made Open Source
• JavaScript Execution
• Many of the Actions Library
• Right click
• moveTo
• sendKeys
© Sauce Labs, Inc. 14
11/1/2016
8
The Actual Problem(s)
Locating Elements in Different Browsers
• Page load times can vary• Page load times can vary
• Elements may not be on the page
• No Such Element Errors
• Pop-ups and/or Alerts are handled differently by each browser
• Elements can be hidden by other elements
• Element not clickable errors
• Individual browser native automation Selenium implementation• Individual browser native automation Selenium implementation
inconsistencies
With today’s access to cloud based Selenium grids, it is easier than ever
to test across all the most popular browsers.
© Sauce Labs, Inc. 15
The Solutions!
Waits
• Built in mechanisms that will allow for variation in website page• Built in mechanisms that will allow for variation in website page
loading times and/or dynamically loading elements
• Two different types that work in different ways
• Implicit Waits
• Explicit Waits
• Sleeps
Understanding driver limitations
• Work Arounds
© Sauce Labs, Inc. 16
11/1/2016
9
Waiting Strategies
Implicit Waits
Implicit Wait
Tells the WebDriver to poll the browser DOM for a certain amount• Tells the WebDriver to poll the browser DOM for a certain amount
of time when trying to find an element or elements if they are not
immediately available.
• Applied to the WebDriver instance itself
© Sauce Labs, Inc. 18
11/1/2016
10
Explicit Waits
Explicit Waits
• Code you define to wait for a certain condition to occur beforeCode you define to wait for a certain condition to occur before
proceeding further in the test.
• E.g. Poll the DOM until the element I’m looking for is visible
• Used with individual elements as opposed to a blanket timeout on
the WebDriver instance
• Sleeps
© Sauce Labs, Inc. 19
But wait… I’m confused…
They sound similar, and a Sleep is also a type of Explicit Wait?
Ne er se Sleeps• Never use Sleeps
• Don’t use Implicit Waits
• Can cause problems when the element you are trying to interact
with is not ready
• E.g. Can be found in the browser DOM before it is visible
• Hidden/Disabled elements
• Use Explicit Waits that Wait for a Condition (Not Time)
• Element to be Enabled, Visible, Clickable, Selected
• Never mix Implicit and Explicit Waits
• Seriously, Never use Sleeps
© Sauce Labs, Inc. 20
11/1/2016
11
Using Explicit Waits
Use them any time an element is not immediately available.
• That is a lot of the time
• Page Loads, Form Submissions, Pop-Ups, etc.
• Example of how to implement in a Page Object:
© Sauce Labs, Inc. 21
Fluent Waits
Fluent Waits
• Build your own Explicit Wait!• Build your own Explicit Wait!
• Configuration
• Timeout
• Polling Rate
• Errors to Ignore
• Use Cases
• Stress on Internal Infrastructure
• Specific Errors
© Sauce Labs, Inc. 22
11/1/2016
12
Driver Workarounds
Driver Specific Workarounds
Send Keys Example:
© Sauce Labs, Inc. 24
11/1/2016
13
Driver Specific Workarounds - 2
Executing JavaScript:
• Don’t do it!Don t do it!
• Executing JavaScript within a functional test doesn’t tell you if the
UI is functioning
• Work with developers to ensure the page is testable
© Sauce Labs, Inc. 25
Resources
• SeleniumHQ
• http://www.seleniumhq.org/docs/
• The Selenium Guidebook by Dave Haeffner
• https://seleniumguidebook.com/
• ”Implicit Waits vs Explicit Waits” by Siva Dhanamjay
• http://www.aptuz.com/blog/selenium-implicit-vs-explicit-waits/
• “Difference Between Implicit, Explicit & Fluent Wait” by Lakshay
Sharma
• http://toolsqa.com/selenium-webdriver/implicit-explicit-n-fluent-wait/
• “Why don’t web browsers render the same content identically?” by
Aaron Boodman
• https://www.quora.com/Why-dont-web-browsers-render-the-same-
content-identically/
© Sauce Labs, Inc. 26
11/1/2016
14
Thank you for attending this
sessionsession.
Please fill out an evaluation form.

More Related Content

What's hot

Automated ui-testing
Automated ui-testingAutomated ui-testing
Automated ui-testing
Slobodan Lohja
 
Helpful Automation Techniques - Selenium Camp 2014
Helpful Automation Techniques - Selenium Camp 2014Helpful Automation Techniques - Selenium Camp 2014
Helpful Automation Techniques - Selenium Camp 2014
Justin Ison
 
Simplify CI with the Updated Jenkins Plugin for Sauce Labs
Simplify CI with the Updated Jenkins Plugin for Sauce LabsSimplify CI with the Updated Jenkins Plugin for Sauce Labs
Simplify CI with the Updated Jenkins Plugin for Sauce Labs
Sauce Labs
 
Java Restart with WebFX
Java Restart with WebFX Java Restart with WebFX
Java Restart with WebFX
Nikita Lipsky
 
Belfast Selenium Meetup
Belfast Selenium MeetupBelfast Selenium Meetup
Belfast Selenium Meetup
Justin Ison
 
Engage 2019: Modernising Your Domino and XPages Applications
Engage 2019: Modernising Your Domino and XPages Applications Engage 2019: Modernising Your Domino and XPages Applications
Engage 2019: Modernising Your Domino and XPages Applications
Paul Withers
 
Automated Exploratory Testing
Automated Exploratory TestingAutomated Exploratory Testing
Automated Exploratory Testing
Justin Ison
 
Selenium Tips & Tricks
Selenium Tips & TricksSelenium Tips & Tricks
Selenium Tips & Tricks
Dave Haeffner
 
Testing desktop apps with selenium
Testing desktop apps with seleniumTesting desktop apps with selenium
Testing desktop apps with selenium
Filip Braun
 
DCAST Meetup - Washington, DC Feb 2016
DCAST Meetup - Washington, DC Feb 2016DCAST Meetup - Washington, DC Feb 2016
DCAST Meetup - Washington, DC Feb 2016
Justin Ison
 
Automated Testing – Web, Mobile, Desktop - Challenges and Successes
Automated Testing – Web, Mobile, Desktop - Challenges and SuccessesAutomated Testing – Web, Mobile, Desktop - Challenges and Successes
Automated Testing – Web, Mobile, Desktop - Challenges and Successes
Ted Drake
 
Selenium Israel Meetup
Selenium Israel MeetupSelenium Israel Meetup
Selenium Israel Meetup
Justin Ison
 
Speed = $$$
Speed = $$$Speed = $$$
Speed = $$$
Peter Gfader
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)Dave Haeffner
 
Testing Salesforce at Cloud Scale
Testing Salesforce at Cloud ScaleTesting Salesforce at Cloud Scale
Testing Salesforce at Cloud Scale
gwestr
 
Continuous Delivery - Voxxed Days Cluj-Napoca 2017
Continuous Delivery - Voxxed Days Cluj-Napoca 2017Continuous Delivery - Voxxed Days Cluj-Napoca 2017
Continuous Delivery - Voxxed Days Cluj-Napoca 2017
Rafał Leszko
 
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium MeetupSelenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Dave Haeffner
 
Practical Tips & Tricks for Selenium Test Automation - Dave Haeffner
Practical Tips & Tricks for Selenium Test Automation - Dave HaeffnerPractical Tips & Tricks for Selenium Test Automation - Dave Haeffner
Practical Tips & Tricks for Selenium Test Automation - Dave Haeffner
Applitools
 
TestMaker Object Designer Training - Basics
TestMaker Object Designer Training - BasicsTestMaker Object Designer Training - Basics
TestMaker Object Designer Training - Basics
Clever Moe
 
Automated Acceptance Testing from Scratch
Automated Acceptance Testing from ScratchAutomated Acceptance Testing from Scratch
Automated Acceptance Testing from Scratch
Excella
 

What's hot (20)

Automated ui-testing
Automated ui-testingAutomated ui-testing
Automated ui-testing
 
Helpful Automation Techniques - Selenium Camp 2014
Helpful Automation Techniques - Selenium Camp 2014Helpful Automation Techniques - Selenium Camp 2014
Helpful Automation Techniques - Selenium Camp 2014
 
Simplify CI with the Updated Jenkins Plugin for Sauce Labs
Simplify CI with the Updated Jenkins Plugin for Sauce LabsSimplify CI with the Updated Jenkins Plugin for Sauce Labs
Simplify CI with the Updated Jenkins Plugin for Sauce Labs
 
Java Restart with WebFX
Java Restart with WebFX Java Restart with WebFX
Java Restart with WebFX
 
Belfast Selenium Meetup
Belfast Selenium MeetupBelfast Selenium Meetup
Belfast Selenium Meetup
 
Engage 2019: Modernising Your Domino and XPages Applications
Engage 2019: Modernising Your Domino and XPages Applications Engage 2019: Modernising Your Domino and XPages Applications
Engage 2019: Modernising Your Domino and XPages Applications
 
Automated Exploratory Testing
Automated Exploratory TestingAutomated Exploratory Testing
Automated Exploratory Testing
 
Selenium Tips & Tricks
Selenium Tips & TricksSelenium Tips & Tricks
Selenium Tips & Tricks
 
Testing desktop apps with selenium
Testing desktop apps with seleniumTesting desktop apps with selenium
Testing desktop apps with selenium
 
DCAST Meetup - Washington, DC Feb 2016
DCAST Meetup - Washington, DC Feb 2016DCAST Meetup - Washington, DC Feb 2016
DCAST Meetup - Washington, DC Feb 2016
 
Automated Testing – Web, Mobile, Desktop - Challenges and Successes
Automated Testing – Web, Mobile, Desktop - Challenges and SuccessesAutomated Testing – Web, Mobile, Desktop - Challenges and Successes
Automated Testing – Web, Mobile, Desktop - Challenges and Successes
 
Selenium Israel Meetup
Selenium Israel MeetupSelenium Israel Meetup
Selenium Israel Meetup
 
Speed = $$$
Speed = $$$Speed = $$$
Speed = $$$
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
 
Testing Salesforce at Cloud Scale
Testing Salesforce at Cloud ScaleTesting Salesforce at Cloud Scale
Testing Salesforce at Cloud Scale
 
Continuous Delivery - Voxxed Days Cluj-Napoca 2017
Continuous Delivery - Voxxed Days Cluj-Napoca 2017Continuous Delivery - Voxxed Days Cluj-Napoca 2017
Continuous Delivery - Voxxed Days Cluj-Napoca 2017
 
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium MeetupSelenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
 
Practical Tips & Tricks for Selenium Test Automation - Dave Haeffner
Practical Tips & Tricks for Selenium Test Automation - Dave HaeffnerPractical Tips & Tricks for Selenium Test Automation - Dave Haeffner
Practical Tips & Tricks for Selenium Test Automation - Dave Haeffner
 
TestMaker Object Designer Training - Basics
TestMaker Object Designer Training - BasicsTestMaker Object Designer Training - Basics
TestMaker Object Designer Training - Basics
 
Automated Acceptance Testing from Scratch
Automated Acceptance Testing from ScratchAutomated Acceptance Testing from Scratch
Automated Acceptance Testing from Scratch
 

Similar to Build Fail-Proof Tests in Any Browser with Selenium

Automation Best Practices
Automation Best PracticesAutomation Best Practices
Automation Best Practices
Sauce Labs
 
JavaOne 2016 - CON3080 - Testing Java Web Applications with Selenium: A Cookbook
JavaOne 2016 - CON3080 - Testing Java Web Applications with Selenium: A CookbookJavaOne 2016 - CON3080 - Testing Java Web Applications with Selenium: A Cookbook
JavaOne 2016 - CON3080 - Testing Java Web Applications with Selenium: A Cookbook
Jorge Hidalgo
 
Selenium presentation
Selenium presentationSelenium presentation
Selenium presentation
shivani thakur
 
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsDevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
Amazon Web Services
 
Cloud for Agile Testing - Burak Koyuncu
Cloud for Agile Testing - Burak KoyuncuCloud for Agile Testing - Burak Koyuncu
Cloud for Agile Testing - Burak Koyuncu
Keytorc Software Testing Services
 
2016 - Fail Proof Ways to Run Beautiful Tests Regardless Of Browser Choice
2016 - Fail Proof Ways to Run Beautiful Tests Regardless Of Browser Choice2016 - Fail Proof Ways to Run Beautiful Tests Regardless Of Browser Choice
2016 - Fail Proof Ways to Run Beautiful Tests Regardless Of Browser Choice
devopsdaysaustin
 
SenchaCon 2016: The Changing Landscape of JavaScript Testing - Joel Watson an...
SenchaCon 2016: The Changing Landscape of JavaScript Testing - Joel Watson an...SenchaCon 2016: The Changing Landscape of JavaScript Testing - Joel Watson an...
SenchaCon 2016: The Changing Landscape of JavaScript Testing - Joel Watson an...
Sencha
 
10 Useful Testing Tools for Open Source Projects @ TuxCon 2015
10 Useful Testing Tools for Open Source Projects @ TuxCon 201510 Useful Testing Tools for Open Source Projects @ TuxCon 2015
10 Useful Testing Tools for Open Source Projects @ TuxCon 2015
Peter Sabev
 
selenium meetup sf talk march 2014 Selenium at Scale
selenium meetup sf talk march 2014 Selenium at Scaleselenium meetup sf talk march 2014 Selenium at Scale
selenium meetup sf talk march 2014 Selenium at Scale
David Louvton
 
Automated Browser Testing
Automated Browser TestingAutomated Browser Testing
Automated Browser Testing
Darren Hickling MBCS
 
Continuous Testing in the Cloud
Continuous Testing in the CloudContinuous Testing in the Cloud
Continuous Testing in the Cloud
TechWell
 
Selenium for everyone
Selenium for everyoneSelenium for everyone
Selenium for everyone
Tft Us
 
Microsoft power point automation-opensourcetestingtools_matrix-1
Microsoft power point   automation-opensourcetestingtools_matrix-1Microsoft power point   automation-opensourcetestingtools_matrix-1
Microsoft power point automation-opensourcetestingtools_matrix-1
tactqa
 
Microsoft power point automation-opensourcetestingtools_matrix-1
Microsoft power point   automation-opensourcetestingtools_matrix-1Microsoft power point   automation-opensourcetestingtools_matrix-1
Microsoft power point automation-opensourcetestingtools_matrix-1
tactqa
 
Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...
Niels Frydenholm
 
Selenium And Its Types
Selenium And Its TypesSelenium And Its Types
Selenium And Its Types
PriyanshuDutta2
 
Advanced Selenium Testing Techniques
Advanced Selenium Testing TechniquesAdvanced Selenium Testing Techniques
Advanced Selenium Testing Techniques
Perfecto by Perforce
 
Application Lifecycle Management
Application Lifecycle ManagementApplication Lifecycle Management
Application Lifecycle Management
Amazon Web Services
 
Selenium Automation
Selenium AutomationSelenium Automation
Selenium Automation
Anuradha Malalasena
 
Automated Visual Regression Testing by Dave Sadlon
Automated Visual Regression Testing by Dave SadlonAutomated Visual Regression Testing by Dave Sadlon
Automated Visual Regression Testing by Dave Sadlon
QA or the Highway
 

Similar to Build Fail-Proof Tests in Any Browser with Selenium (20)

Automation Best Practices
Automation Best PracticesAutomation Best Practices
Automation Best Practices
 
JavaOne 2016 - CON3080 - Testing Java Web Applications with Selenium: A Cookbook
JavaOne 2016 - CON3080 - Testing Java Web Applications with Selenium: A CookbookJavaOne 2016 - CON3080 - Testing Java Web Applications with Selenium: A Cookbook
JavaOne 2016 - CON3080 - Testing Java Web Applications with Selenium: A Cookbook
 
Selenium presentation
Selenium presentationSelenium presentation
Selenium presentation
 
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsDevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
 
Cloud for Agile Testing - Burak Koyuncu
Cloud for Agile Testing - Burak KoyuncuCloud for Agile Testing - Burak Koyuncu
Cloud for Agile Testing - Burak Koyuncu
 
2016 - Fail Proof Ways to Run Beautiful Tests Regardless Of Browser Choice
2016 - Fail Proof Ways to Run Beautiful Tests Regardless Of Browser Choice2016 - Fail Proof Ways to Run Beautiful Tests Regardless Of Browser Choice
2016 - Fail Proof Ways to Run Beautiful Tests Regardless Of Browser Choice
 
SenchaCon 2016: The Changing Landscape of JavaScript Testing - Joel Watson an...
SenchaCon 2016: The Changing Landscape of JavaScript Testing - Joel Watson an...SenchaCon 2016: The Changing Landscape of JavaScript Testing - Joel Watson an...
SenchaCon 2016: The Changing Landscape of JavaScript Testing - Joel Watson an...
 
10 Useful Testing Tools for Open Source Projects @ TuxCon 2015
10 Useful Testing Tools for Open Source Projects @ TuxCon 201510 Useful Testing Tools for Open Source Projects @ TuxCon 2015
10 Useful Testing Tools for Open Source Projects @ TuxCon 2015
 
selenium meetup sf talk march 2014 Selenium at Scale
selenium meetup sf talk march 2014 Selenium at Scaleselenium meetup sf talk march 2014 Selenium at Scale
selenium meetup sf talk march 2014 Selenium at Scale
 
Automated Browser Testing
Automated Browser TestingAutomated Browser Testing
Automated Browser Testing
 
Continuous Testing in the Cloud
Continuous Testing in the CloudContinuous Testing in the Cloud
Continuous Testing in the Cloud
 
Selenium for everyone
Selenium for everyoneSelenium for everyone
Selenium for everyone
 
Microsoft power point automation-opensourcetestingtools_matrix-1
Microsoft power point   automation-opensourcetestingtools_matrix-1Microsoft power point   automation-opensourcetestingtools_matrix-1
Microsoft power point automation-opensourcetestingtools_matrix-1
 
Microsoft power point automation-opensourcetestingtools_matrix-1
Microsoft power point   automation-opensourcetestingtools_matrix-1Microsoft power point   automation-opensourcetestingtools_matrix-1
Microsoft power point automation-opensourcetestingtools_matrix-1
 
Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...
 
Selenium And Its Types
Selenium And Its TypesSelenium And Its Types
Selenium And Its Types
 
Advanced Selenium Testing Techniques
Advanced Selenium Testing TechniquesAdvanced Selenium Testing Techniques
Advanced Selenium Testing Techniques
 
Application Lifecycle Management
Application Lifecycle ManagementApplication Lifecycle Management
Application Lifecycle Management
 
Selenium Automation
Selenium AutomationSelenium Automation
Selenium Automation
 
Automated Visual Regression Testing by Dave Sadlon
Automated Visual Regression Testing by Dave SadlonAutomated Visual Regression Testing by Dave Sadlon
Automated Visual Regression Testing by Dave Sadlon
 

More from TechWell

Failing and Recovering
Failing and RecoveringFailing and Recovering
Failing and Recovering
TechWell
 
Instill a DevOps Testing Culture in Your Team and Organization
Instill a DevOps Testing Culture in Your Team and Organization Instill a DevOps Testing Culture in Your Team and Organization
Instill a DevOps Testing Culture in Your Team and Organization
TechWell
 
Test Design for Fully Automated Build Architecture
Test Design for Fully Automated Build ArchitectureTest Design for Fully Automated Build Architecture
Test Design for Fully Automated Build Architecture
TechWell
 
System-Level Test Automation: Ensuring a Good Start
System-Level Test Automation: Ensuring a Good StartSystem-Level Test Automation: Ensuring a Good Start
System-Level Test Automation: Ensuring a Good Start
TechWell
 
Build Your Mobile App Quality and Test Strategy
Build Your Mobile App Quality and Test StrategyBuild Your Mobile App Quality and Test Strategy
Build Your Mobile App Quality and Test Strategy
TechWell
 
Testing Transformation: The Art and Science for Success
Testing Transformation: The Art and Science for SuccessTesting Transformation: The Art and Science for Success
Testing Transformation: The Art and Science for Success
TechWell
 
Implement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlowImplement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlow
TechWell
 
Develop WebDriver Automated Tests—and Keep Your Sanity
Develop WebDriver Automated Tests—and Keep Your SanityDevelop WebDriver Automated Tests—and Keep Your Sanity
Develop WebDriver Automated Tests—and Keep Your Sanity
TechWell
 
Ma 15
Ma 15Ma 15
Ma 15
TechWell
 
Eliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps StrategyEliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps Strategy
TechWell
 
Transform Test Organizations for the New World of DevOps
Transform Test Organizations for the New World of DevOpsTransform Test Organizations for the New World of DevOps
Transform Test Organizations for the New World of DevOps
TechWell
 
The Fourth Constraint in Project Delivery—Leadership
The Fourth Constraint in Project Delivery—LeadershipThe Fourth Constraint in Project Delivery—Leadership
The Fourth Constraint in Project Delivery—Leadership
TechWell
 
Resolve the Contradiction of Specialists within Agile Teams
Resolve the Contradiction of Specialists within Agile TeamsResolve the Contradiction of Specialists within Agile Teams
Resolve the Contradiction of Specialists within Agile Teams
TechWell
 
Pin the Tail on the Metric: A Field-Tested Agile Game
Pin the Tail on the Metric: A Field-Tested Agile GamePin the Tail on the Metric: A Field-Tested Agile Game
Pin the Tail on the Metric: A Field-Tested Agile Game
TechWell
 
Agile Performance Holarchy (APH)—A Model for Scaling Agile Teams
Agile Performance Holarchy (APH)—A Model for Scaling Agile TeamsAgile Performance Holarchy (APH)—A Model for Scaling Agile Teams
Agile Performance Holarchy (APH)—A Model for Scaling Agile Teams
TechWell
 
A Business-First Approach to DevOps Implementation
A Business-First Approach to DevOps ImplementationA Business-First Approach to DevOps Implementation
A Business-First Approach to DevOps Implementation
TechWell
 
Databases in a Continuous Integration/Delivery Process
Databases in a Continuous Integration/Delivery ProcessDatabases in a Continuous Integration/Delivery Process
Databases in a Continuous Integration/Delivery Process
TechWell
 
Mobile Testing: What—and What Not—to Automate
Mobile Testing: What—and What Not—to AutomateMobile Testing: What—and What Not—to Automate
Mobile Testing: What—and What Not—to Automate
TechWell
 
Cultural Intelligence: A Key Skill for Success
Cultural Intelligence: A Key Skill for SuccessCultural Intelligence: A Key Skill for Success
Cultural Intelligence: A Key Skill for Success
TechWell
 
Turn the Lights On: A Power Utility Company's Agile Transformation
Turn the Lights On: A Power Utility Company's Agile TransformationTurn the Lights On: A Power Utility Company's Agile Transformation
Turn the Lights On: A Power Utility Company's Agile Transformation
TechWell
 

More from TechWell (20)

Failing and Recovering
Failing and RecoveringFailing and Recovering
Failing and Recovering
 
Instill a DevOps Testing Culture in Your Team and Organization
Instill a DevOps Testing Culture in Your Team and Organization Instill a DevOps Testing Culture in Your Team and Organization
Instill a DevOps Testing Culture in Your Team and Organization
 
Test Design for Fully Automated Build Architecture
Test Design for Fully Automated Build ArchitectureTest Design for Fully Automated Build Architecture
Test Design for Fully Automated Build Architecture
 
System-Level Test Automation: Ensuring a Good Start
System-Level Test Automation: Ensuring a Good StartSystem-Level Test Automation: Ensuring a Good Start
System-Level Test Automation: Ensuring a Good Start
 
Build Your Mobile App Quality and Test Strategy
Build Your Mobile App Quality and Test StrategyBuild Your Mobile App Quality and Test Strategy
Build Your Mobile App Quality and Test Strategy
 
Testing Transformation: The Art and Science for Success
Testing Transformation: The Art and Science for SuccessTesting Transformation: The Art and Science for Success
Testing Transformation: The Art and Science for Success
 
Implement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlowImplement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlow
 
Develop WebDriver Automated Tests—and Keep Your Sanity
Develop WebDriver Automated Tests—and Keep Your SanityDevelop WebDriver Automated Tests—and Keep Your Sanity
Develop WebDriver Automated Tests—and Keep Your Sanity
 
Ma 15
Ma 15Ma 15
Ma 15
 
Eliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps StrategyEliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps Strategy
 
Transform Test Organizations for the New World of DevOps
Transform Test Organizations for the New World of DevOpsTransform Test Organizations for the New World of DevOps
Transform Test Organizations for the New World of DevOps
 
The Fourth Constraint in Project Delivery—Leadership
The Fourth Constraint in Project Delivery—LeadershipThe Fourth Constraint in Project Delivery—Leadership
The Fourth Constraint in Project Delivery—Leadership
 
Resolve the Contradiction of Specialists within Agile Teams
Resolve the Contradiction of Specialists within Agile TeamsResolve the Contradiction of Specialists within Agile Teams
Resolve the Contradiction of Specialists within Agile Teams
 
Pin the Tail on the Metric: A Field-Tested Agile Game
Pin the Tail on the Metric: A Field-Tested Agile GamePin the Tail on the Metric: A Field-Tested Agile Game
Pin the Tail on the Metric: A Field-Tested Agile Game
 
Agile Performance Holarchy (APH)—A Model for Scaling Agile Teams
Agile Performance Holarchy (APH)—A Model for Scaling Agile TeamsAgile Performance Holarchy (APH)—A Model for Scaling Agile Teams
Agile Performance Holarchy (APH)—A Model for Scaling Agile Teams
 
A Business-First Approach to DevOps Implementation
A Business-First Approach to DevOps ImplementationA Business-First Approach to DevOps Implementation
A Business-First Approach to DevOps Implementation
 
Databases in a Continuous Integration/Delivery Process
Databases in a Continuous Integration/Delivery ProcessDatabases in a Continuous Integration/Delivery Process
Databases in a Continuous Integration/Delivery Process
 
Mobile Testing: What—and What Not—to Automate
Mobile Testing: What—and What Not—to AutomateMobile Testing: What—and What Not—to Automate
Mobile Testing: What—and What Not—to Automate
 
Cultural Intelligence: A Key Skill for Success
Cultural Intelligence: A Key Skill for SuccessCultural Intelligence: A Key Skill for Success
Cultural Intelligence: A Key Skill for Success
 
Turn the Lights On: A Power Utility Company's Agile Transformation
Turn the Lights On: A Power Utility Company's Agile TransformationTurn the Lights On: A Power Utility Company's Agile Transformation
Turn the Lights On: A Power Utility Company's Agile Transformation
 

Recently uploaded

Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
NaapbooksPrivateLimi
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
Peter Caitens
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
WSO2
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 

Recently uploaded (20)

Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 

Build Fail-Proof Tests in Any Browser with Selenium

  • 1. BT12 Test Automation 11/17/2016 3:00:00 PM Build Fail-Proof Tests in Any Browser with Selenium Presented by: Kevin Berg Sauce Labs Brought to you by: 350 Corporate Way, Suite 400, Orange Park, FL 32073 888--‐268--‐8770 ·∙ 904--‐278--‐0524 - info@techwell.com - http://www.stareast.techwell.com/
  • 2. Kevin Berg Sauce Labs Kevin Berg is a customer automation specialist at Sauce Labs where he works with prospective, new, and existing customers to adapt their tests and frameworks to enhance their parallel and cross browser testing capabilities. Kevin has written test framework examples that exhibit both parallel execution and cross browser testing capability for desktop and mobile platforms. As a proponent of open source materials, these examples are publicly available on GitHub (@KevinMarkVI). A classical musician turned software engineer, Kevin enjoys watching sports, playing video games, and spending time outdoors with his wife and dog.
  • 3. 11/1/2016 1 Fail Proof Tests in Any BrowserFail Proof Tests in Any Browser with Seleniumwith Seleniumwith Seleniumwith Selenium K E V I N B E R G , C U S T O M E R A U T O M AT I O N S P E C I A L I S T Kevin Berg A little about me: D r. K e v i n B e r g , D M A • Help customers transition from running test manually or on local Selenium grids, to parallel cross-browser testing in the cloud • Write custom testing frameworks, features, and Selenium scripts • Selenium/Appium workshops and training • CI/CD architecture and integrationCI/CD architecture and integration © Sauce Labs, Inc. 2
  • 4. 11/1/2016 2 Agenda • Selenium – Quick Overview • The Problem Statement • Why Cross Browser Testing is Important • The Actual Problem(s) • The Solutions • Questions • More Questions? Come by the Sauce Labs booth! © Sauce Labs, Inc. 3 Selenium – Quick Overview Browser Automation Framework: • Open source • Used mainly for testing purposes • Automates all the most popular browsers • Selenium can replicate nearly any user interaction with the browser • Bindings to all the most commonly use programming languages • Natural language commands make it simple to start writing tests © Sauce Labs, Inc. 4
  • 5. 11/1/2016 3 Automating with Selenium browser • get(“www myWebsite com”);• .get( www.myWebsite.com ); • .findElement(); • .click(); • .submit(); • .sendKeys(); • .isDisplayed(); © Sauce Labs, Inc. 5 The Problem The Usual Story 1. Selenium tests are written in Firefox 2. Tests Pass! 3. Run Same tests in Internet Explorer 4. Tests Fail! 5. Anger What is Happening? © Sauce Labs, Inc. 6
  • 6. 11/1/2016 4 Our Problem is Actually Two Problems Browsers • They are not all the same Browser Automation Drivers • Also not the same © Sauce Labs, Inc. 7 Browsers
  • 7. 11/1/2016 5 Why Firefox? • Came out of the box with Selenium • WebDriver driver = new FirefoxDriver(); • Up to Firefox version 47 • Selenium IDE Firefox Plugin • Open Source • Dotted lines Firefox Chrome © Sauce Labs, Inc. 9 Chrome Browsers Each browser uses a different rendering (or layout) engine: • WebKit (Safari and iOS)WebKit (Safari and iOS) • Blink (Chrome, Opera) • Gecko (Firefox) • Trident (Internet Explorer) • EdgeHTML (Microsoft Edge) HTML and CSS: • Complex with new features being added and others depreciated • Errors handled differently Can lead to elements being covered or not visible. © Sauce Labs, Inc. 10
  • 8. 11/1/2016 6 Browser Timing Issues Some rendering engines are faster than others • Chrome (Fast) • Internet Explorer (Not as fast… ) AJAX Requests • DOM is accessed with JavaScript to dynamically display the information presented © Sauce Labs, Inc. 11 Drivers
  • 9. 11/1/2016 7 Browser Automation Drivers Each Browser has its own Native Automation Support • Firefox Marionette• Firefox - Marionette • Version 48 moved from FirefoxDriver to Marionette • Many Selenium methods still being implemented • https://developer.mozilla.org/en- US/docs/Mozilla/QA/Marionette/WebDriver/status © Sauce Labs, Inc. 13 Browser Automation Drivers - Continued • Internet Explorer • Issues with Actions Library • moveTo • hover • Safari • Recently made Open Source • JavaScript Execution • Many of the Actions Library • Right click • moveTo • sendKeys © Sauce Labs, Inc. 14
  • 10. 11/1/2016 8 The Actual Problem(s) Locating Elements in Different Browsers • Page load times can vary• Page load times can vary • Elements may not be on the page • No Such Element Errors • Pop-ups and/or Alerts are handled differently by each browser • Elements can be hidden by other elements • Element not clickable errors • Individual browser native automation Selenium implementation• Individual browser native automation Selenium implementation inconsistencies With today’s access to cloud based Selenium grids, it is easier than ever to test across all the most popular browsers. © Sauce Labs, Inc. 15 The Solutions! Waits • Built in mechanisms that will allow for variation in website page• Built in mechanisms that will allow for variation in website page loading times and/or dynamically loading elements • Two different types that work in different ways • Implicit Waits • Explicit Waits • Sleeps Understanding driver limitations • Work Arounds © Sauce Labs, Inc. 16
  • 11. 11/1/2016 9 Waiting Strategies Implicit Waits Implicit Wait Tells the WebDriver to poll the browser DOM for a certain amount• Tells the WebDriver to poll the browser DOM for a certain amount of time when trying to find an element or elements if they are not immediately available. • Applied to the WebDriver instance itself © Sauce Labs, Inc. 18
  • 12. 11/1/2016 10 Explicit Waits Explicit Waits • Code you define to wait for a certain condition to occur beforeCode you define to wait for a certain condition to occur before proceeding further in the test. • E.g. Poll the DOM until the element I’m looking for is visible • Used with individual elements as opposed to a blanket timeout on the WebDriver instance • Sleeps © Sauce Labs, Inc. 19 But wait… I’m confused… They sound similar, and a Sleep is also a type of Explicit Wait? Ne er se Sleeps• Never use Sleeps • Don’t use Implicit Waits • Can cause problems when the element you are trying to interact with is not ready • E.g. Can be found in the browser DOM before it is visible • Hidden/Disabled elements • Use Explicit Waits that Wait for a Condition (Not Time) • Element to be Enabled, Visible, Clickable, Selected • Never mix Implicit and Explicit Waits • Seriously, Never use Sleeps © Sauce Labs, Inc. 20
  • 13. 11/1/2016 11 Using Explicit Waits Use them any time an element is not immediately available. • That is a lot of the time • Page Loads, Form Submissions, Pop-Ups, etc. • Example of how to implement in a Page Object: © Sauce Labs, Inc. 21 Fluent Waits Fluent Waits • Build your own Explicit Wait!• Build your own Explicit Wait! • Configuration • Timeout • Polling Rate • Errors to Ignore • Use Cases • Stress on Internal Infrastructure • Specific Errors © Sauce Labs, Inc. 22
  • 14. 11/1/2016 12 Driver Workarounds Driver Specific Workarounds Send Keys Example: © Sauce Labs, Inc. 24
  • 15. 11/1/2016 13 Driver Specific Workarounds - 2 Executing JavaScript: • Don’t do it!Don t do it! • Executing JavaScript within a functional test doesn’t tell you if the UI is functioning • Work with developers to ensure the page is testable © Sauce Labs, Inc. 25 Resources • SeleniumHQ • http://www.seleniumhq.org/docs/ • The Selenium Guidebook by Dave Haeffner • https://seleniumguidebook.com/ • ”Implicit Waits vs Explicit Waits” by Siva Dhanamjay • http://www.aptuz.com/blog/selenium-implicit-vs-explicit-waits/ • “Difference Between Implicit, Explicit & Fluent Wait” by Lakshay Sharma • http://toolsqa.com/selenium-webdriver/implicit-explicit-n-fluent-wait/ • “Why don’t web browsers render the same content identically?” by Aaron Boodman • https://www.quora.com/Why-dont-web-browsers-render-the-same- content-identically/ © Sauce Labs, Inc. 26
  • 16. 11/1/2016 14 Thank you for attending this sessionsession. Please fill out an evaluation form.