SlideShare uma empresa Scribd logo
1 de 20
Baixar para ler offline
 
	
  
	
  
	
  
	
  
T9	
  
Test	
  Automation	
  
10/5/17	
  11:15	
  
	
  
	
  
	
  
	
  
Say	
  Goodbye	
  to	
  Flaky	
  Selenium	
  Tests	
  
	
  
Presented	
  by:	
  
	
  
Craig	
  Schwarzwald	
  
	
  Vanguard	
  
	
  
Brought	
  to	
  you	
  by:	
  	
  
	
  	
  
	
  
	
  
	
  
	
  
	
  
350	
  Corporate	
  Way,	
  Suite	
  400,	
  Orange	
  Park,	
  FL	
  32073	
  	
  
888-­‐-­‐-­‐268-­‐-­‐-­‐8770	
  ·∙·∙	
  904-­‐-­‐-­‐278-­‐-­‐-­‐0524	
  -­‐	
  info@techwell.com	
  -­‐	
  http://www.starwest.techwell.com/	
  	
  	
  
	
  
	
  	
  
	
  
	
  
Craig	
  Schwarzwald	
  
Vanguard	
  
	
  
Craig	
  Schwarzwald	
  has	
  more	
  than	
  a	
  decade	
  of	
  professional	
  scripting	
  and	
  
automation	
  experience.	
  For	
  the	
  past	
  six	
  years	
  he	
  has	
  focused	
  on	
  creating	
  and	
  
maintaining	
  the	
  Selenium	
  framework	
  used	
  by	
  hundreds	
  of	
  testers,	
  developers,	
  
and	
  automation	
  engineers	
  at	
  a	
  large	
  financial	
  organization.	
  Widely	
  regarded	
  as	
  
his	
  company’s	
  Selenium	
  expert,	
  Craig	
  holds	
  weekly	
  ‰ÛÏoffice	
  hours‰Û	
  
sessions	
  to	
  supply	
  solutions	
  to	
  teams’	
  most	
  difficult	
  Selenium-­‐based	
  challenges.	
  
He	
  teaches	
  a	
  two-­‐day	
  Selenium	
  course	
  to	
  new	
  automation	
  engineers	
  looking	
  to	
  
learn	
  Selenium.	
  In	
  his	
  spare	
  time,	
  Craig	
  enjoys	
  bowling,	
  playing	
  softball,	
  and	
  
having	
  passionate	
  discussions	
  about	
  Selenium,	
  test	
  automation,	
  and	
  any	
  other	
  
Shift	
  Left	
  related	
  topics.	
  Follow	
  Craig	
  on	
  Twitter	
  @AutomationCraig.	
  
	
  
1
Say Goodbye to
Flaky Selenium Tests
Craig Schwarzwald | Vanguard
Craig_Schwarzwald@vanguard.com @AutomationCraig
About Craig Schwarzwald
▪  Worked for Vanguard over 10 years
▪  Many different roles:
▪  System Tester, UI Developer, Mobile Developer, Automation Engineer
▪  Always focused on Automated Testing
▪  2007-2010: QTP
▪  2010-Present: Selenium
▪  Contributor to OCPSoft Blog
▪  Majority of the contents in this presentation can be found in my blog article:
http://www.ocpsoft.org/opensource/flakiness-of-corporate-selenium-suites-and-how-to-get-rid-of-it/
2
Agenda
Goal: Throughout The Entire Enterprise
▪ Stability
▪ Maintainability
▪ Readability
3
Stability
Wait Strategies
1) Hard wait
2) Implicit Wait
3) Explicit Wait
4
Hard Wait
Ex:	
  Thread.sleep(3000);	
  
	
  
	
  
	
  
Implicit Wait
Ex:	
  driver.manage().9meouts.implicitWait(3,	
  TimeUnit.SECONDS);	
  
	
  
	
  
	
  
5
Explicit Wait
Ex:	
  
WebDriverWait	
  wait	
  =	
  new	
  WebDriverWait(driver,	
  3);	
  
Wait.un9l(ExpectedCondi9ons.elementToBeClickable(locator);	
  
	
  
	
  
Maintainability
6
Issue: Poor Maintainability
Solution:
1) Good locators
2) Page Objects
What are good locators?
1) Unique
2) Descriptive
3) Unlikely to change
7
Issue: Bad Locators
driver.findElement(By.xpath(“//div[34]/span[21]”	
  +	
  	
  
	
  “/table/tbody/tr[17]/td[2]/input”)).click();	
  
	
  
Solution: Use better ones
By	
  con9nueBtn	
  =	
  By.id(“con9nueBuWon”);	
  
click(con9nueBtn);	
  
By	
  con9nueBtn	
  =	
  By.xpath(“//input[value=‘Con9nue’]”);	
  
click(con9nueBtn);	
  
or	
  if	
  there	
  is	
  no	
  ID:	
  
Solution: Page Objects
Construc9on:	
  
	
  -­‐	
  By	
  locators	
  pertaining	
  to	
  page/sec9on	
  on	
  top	
  
	
  	
  
	
  
	
  
	
  
	
  -­‐	
  Constructor	
  
	
  
	
  
	
  
	
  
	
  -­‐	
  isLoaded()	
  method	
  
	
  
	
  
	
  
	
  
	
  -­‐	
  Finally	
  create	
  all	
  user	
  ac9on	
  methods	
  specific	
  to	
  that	
  page.	
  
8
Base Page Object
▪ Wraps Selenium core functionality
▪ findElement(),	
  click(),	
  isDisplayed(),	
  visit(),	
  etc.
▪ Also	
  add	
  common	
  func9ons	
  to	
  be	
  used	
  across	
  teams	
  
▪ getCellFromTableContainingText(byTable,	
  text);	
  
	
  
	
  
▪ selectWizzyWidget(value);
Framework Base Page
Corporate Base Page
Readability
9
Rules to Follow
Page Objects
▪  Contain all locators
▪  Contain methods for any actions you can do on
the corresponding page / section of page.
Rules to Follow
Tests
▪  Perform assertion(s)
▪  Call page object methods to progress the tests.
▪  (Assign variables to make tests more readable)
10
Rules to Follow – The DON’Ts
Page Objects DON’T:
▪  Make any assertions
Tests DON’T:
▪  Refer to locators anywhere within the test
NIETHER Page Objects NOR Tests:
▪  Call Selenium commands directly
BONUS
11
Base Page Object Benefits
▪ Encapsulate all Selenium commands
▪ All	
  pages	
  get	
  auto-­‐enabled	
  func9onality	
  
▪ One	
  single	
  place	
  to	
  implement	
  all	
  the	
  null	
  checks,	
  
failsafe’s,	
  and	
  logging.	
  
▪ No	
  more	
  NoSuchElementExcep9ons	
  or	
  
StaleElementReferenceExcep9ons.
Let’s look into the code!
12
Solution: Framework Code
Solution: Framework Code
13
Solution: Framework Code
Solution: Corporate Override Example
14
Solution: Framework Code
“Real World” Corporate
Example
15
Corporate Example – Shopping Home (1 of 2)
Corporate Example – Shopping Home (2 of 2)
16
Corporate Example – Buy Item
Corporate Example – Confirm Page
17
Framework Code – Selenium Base Test
Corporate Example – Selenium Test
18
Summary
Summary – Achieve all 3 pillars 


across our entire Enterprise
▪  Stability (Explicit Waits + Verifying Page Loads)
▪  Maintainability (Page Objects + Good Locators)
▪  Readability (Following Page Object and Test Rules)
▪  More details can be found on the blog post this talk was based on:
http://www.ocpsoft.org/opensource/flakiness-of-corporate-selenium-suites-and-how-to-get-rid-of-it/
Craig_Schwarzwald@vanguard.com @AutomationCraig

Mais conteúdo relacionado

Mais procurados

AngularJS + CSP: A Perfect Match or Unhappy Marriage?
AngularJS + CSP: A Perfect Match or Unhappy Marriage?AngularJS + CSP: A Perfect Match or Unhappy Marriage?
AngularJS + CSP: A Perfect Match or Unhappy Marriage?David Johansson
 
Protractor for angularJS
Protractor for angularJSProtractor for angularJS
Protractor for angularJSKrishna Kumar
 
Cypress - Best Practices
Cypress - Best PracticesCypress - Best Practices
Cypress - Best PracticesBrian Mann
 
Selenium Basics Crashcourse
Selenium Basics CrashcourseSelenium Basics Crashcourse
Selenium Basics CrashcourseDaniel Herken
 
EF Core não é lento vou te provar!
EF Core não é lento vou te provar!EF Core não é lento vou te provar!
EF Core não é lento vou te provar!Rafael Almeida
 
Automated Testing using JavaScript
Automated Testing using JavaScriptAutomated Testing using JavaScript
Automated Testing using JavaScriptSimon Guest
 
Run Selenium Tests With Jenkins and BrowseEmAll
Run Selenium Tests With Jenkins and BrowseEmAllRun Selenium Tests With Jenkins and BrowseEmAll
Run Selenium Tests With Jenkins and BrowseEmAllDaniel Herken
 
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil TayarCypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil TayarApplitools
 
Apex Testing Deep Dive
Apex Testing Deep DiveApex Testing Deep Dive
Apex Testing Deep DiveAdam Olshansky
 
Automated testing with Cypress
Automated testing with CypressAutomated testing with Cypress
Automated testing with CypressYong Shean Chong
 
Selenium IDE and Beyond
Selenium IDE and BeyondSelenium IDE and Beyond
Selenium IDE and BeyondSamit Badle
 
Integration testing with specs formvc
Integration testing with specs formvcIntegration testing with specs formvc
Integration testing with specs formvcmatthoneycutt
 
TestingAR XX - Protractor e2e Test Framework - Introduction what we have lear...
TestingAR XX - Protractor e2e Test Framework - Introduction what we have lear...TestingAR XX - Protractor e2e Test Framework - Introduction what we have lear...
TestingAR XX - Protractor e2e Test Framework - Introduction what we have lear...TestingAR Meetup
 
Automated UI testing.Selenium.DrupalCamp Kyiv 2011
Automated UI testing.Selenium.DrupalCamp Kyiv 2011Automated UI testing.Selenium.DrupalCamp Kyiv 2011
Automated UI testing.Selenium.DrupalCamp Kyiv 2011camp_drupal_ua
 

Mais procurados (17)

AngularJS + CSP: A Perfect Match or Unhappy Marriage?
AngularJS + CSP: A Perfect Match or Unhappy Marriage?AngularJS + CSP: A Perfect Match or Unhappy Marriage?
AngularJS + CSP: A Perfect Match or Unhappy Marriage?
 
Protractor for angularJS
Protractor for angularJSProtractor for angularJS
Protractor for angularJS
 
Away day
Away dayAway day
Away day
 
Cypress - Best Practices
Cypress - Best PracticesCypress - Best Practices
Cypress - Best Practices
 
Selenium Basics Crashcourse
Selenium Basics CrashcourseSelenium Basics Crashcourse
Selenium Basics Crashcourse
 
EF Core não é lento vou te provar!
EF Core não é lento vou te provar!EF Core não é lento vou te provar!
EF Core não é lento vou te provar!
 
Automated Testing using JavaScript
Automated Testing using JavaScriptAutomated Testing using JavaScript
Automated Testing using JavaScript
 
Selenium
SeleniumSelenium
Selenium
 
Run Selenium Tests With Jenkins and BrowseEmAll
Run Selenium Tests With Jenkins and BrowseEmAllRun Selenium Tests With Jenkins and BrowseEmAll
Run Selenium Tests With Jenkins and BrowseEmAll
 
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil TayarCypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
 
Apex Testing Deep Dive
Apex Testing Deep DiveApex Testing Deep Dive
Apex Testing Deep Dive
 
Automated testing with Cypress
Automated testing with CypressAutomated testing with Cypress
Automated testing with Cypress
 
Selenium IDE and Beyond
Selenium IDE and BeyondSelenium IDE and Beyond
Selenium IDE and Beyond
 
Integration testing with specs formvc
Integration testing with specs formvcIntegration testing with specs formvc
Integration testing with specs formvc
 
TestingAR XX - Protractor e2e Test Framework - Introduction what we have lear...
TestingAR XX - Protractor e2e Test Framework - Introduction what we have lear...TestingAR XX - Protractor e2e Test Framework - Introduction what we have lear...
TestingAR XX - Protractor e2e Test Framework - Introduction what we have lear...
 
Jasmine framework
Jasmine frameworkJasmine framework
Jasmine framework
 
Automated UI testing.Selenium.DrupalCamp Kyiv 2011
Automated UI testing.Selenium.DrupalCamp Kyiv 2011Automated UI testing.Selenium.DrupalCamp Kyiv 2011
Automated UI testing.Selenium.DrupalCamp Kyiv 2011
 

Semelhante a Say Goodbye to Flaky Selenium Tests

Continuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and JenkinsContinuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and JenkinsSOASTA
 
Continuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and JenkinsContinuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and JenkinsSOASTA
 
Selenium withnet
Selenium withnetSelenium withnet
Selenium withnetVlad Maniak
 
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 CookbookJorge Hidalgo
 
Selenium Interview Questions and Answers For Freshers And Experienced | Edureka
Selenium Interview Questions and Answers For Freshers And Experienced | EdurekaSelenium Interview Questions and Answers For Freshers And Experienced | Edureka
Selenium Interview Questions and Answers For Freshers And Experienced | EdurekaEdureka!
 
Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...
Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...
Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...Edureka!
 
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...Ondřej Machulda
 
Build Fail-Proof Tests in Any Browser with Selenium
Build Fail-Proof Tests in Any Browser with SeleniumBuild Fail-Proof Tests in Any Browser with Selenium
Build Fail-Proof Tests in Any Browser with SeleniumTechWell
 
Easy Setup for Parallel Test Execution with Selenium Docker
Easy Setup for Parallel Test Execution with Selenium DockerEasy Setup for Parallel Test Execution with Selenium Docker
Easy Setup for Parallel Test Execution with Selenium DockerSargis Sargsyan
 
Turbocharge Your Automation Framework to Shorten Regression Execution Time
Turbocharge Your Automation Framework to Shorten Regression Execution TimeTurbocharge Your Automation Framework to Shorten Regression Execution Time
Turbocharge Your Automation Framework to Shorten Regression Execution TimeJosiah Renaudin
 
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 ScaleDavid Louvton
 
Interview Question & Answers for Selenium Freshers | LearningSlot
Interview Question & Answers for Selenium Freshers | LearningSlotInterview Question & Answers for Selenium Freshers | LearningSlot
Interview Question & Answers for Selenium Freshers | LearningSlotLearning Slot
 
How to use selenium successfully
How to use selenium successfullyHow to use selenium successfully
How to use selenium successfullyTEST Huddle
 
The Selenium Grid: Run Multiple Automated Tests in Parallel
The Selenium Grid: Run Multiple Automated Tests in ParallelThe Selenium Grid: Run Multiple Automated Tests in Parallel
The Selenium Grid: Run Multiple Automated Tests in ParallelJosiah Renaudin
 
Salesforce selenium-saucelabs-webinar-april-2014
Salesforce selenium-saucelabs-webinar-april-2014Salesforce selenium-saucelabs-webinar-april-2014
Salesforce selenium-saucelabs-webinar-april-2014Sauce Labs
 
Selenium
SeleniumSelenium
Seleniumg2ix
 
How EVERFI Moved from No Automation to Continuous Test Generation in 9 Months
How EVERFI Moved from No Automation to Continuous Test Generation in 9 MonthsHow EVERFI Moved from No Automation to Continuous Test Generation in 9 Months
How EVERFI Moved from No Automation to Continuous Test Generation in 9 MonthsApplitools
 

Semelhante a Say Goodbye to Flaky Selenium Tests (20)

Continuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and JenkinsContinuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and Jenkins
 
Continuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and JenkinsContinuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and Jenkins
 
Selenium withnet
Selenium withnetSelenium withnet
Selenium withnet
 
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 Interview Questions and Answers For Freshers And Experienced | Edureka
Selenium Interview Questions and Answers For Freshers And Experienced | EdurekaSelenium Interview Questions and Answers For Freshers And Experienced | Edureka
Selenium Interview Questions and Answers For Freshers And Experienced | Edureka
 
Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...
Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...
Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...
 
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
 
Build Fail-Proof Tests in Any Browser with Selenium
Build Fail-Proof Tests in Any Browser with SeleniumBuild Fail-Proof Tests in Any Browser with Selenium
Build Fail-Proof Tests in Any Browser with Selenium
 
Easy Setup for Parallel Test Execution with Selenium Docker
Easy Setup for Parallel Test Execution with Selenium DockerEasy Setup for Parallel Test Execution with Selenium Docker
Easy Setup for Parallel Test Execution with Selenium Docker
 
Turbocharge Your Automation Framework to Shorten Regression Execution Time
Turbocharge Your Automation Framework to Shorten Regression Execution TimeTurbocharge Your Automation Framework to Shorten Regression Execution Time
Turbocharge Your Automation Framework to Shorten Regression Execution Time
 
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
 
Interview Question & Answers for Selenium Freshers | LearningSlot
Interview Question & Answers for Selenium Freshers | LearningSlotInterview Question & Answers for Selenium Freshers | LearningSlot
Interview Question & Answers for Selenium Freshers | LearningSlot
 
How to use selenium successfully
How to use selenium successfullyHow to use selenium successfully
How to use selenium successfully
 
The Selenium Grid: Run Multiple Automated Tests in Parallel
The Selenium Grid: Run Multiple Automated Tests in ParallelThe Selenium Grid: Run Multiple Automated Tests in Parallel
The Selenium Grid: Run Multiple Automated Tests in Parallel
 
Selenium testing - Handle Elements in WebDriver
Selenium testing - Handle Elements in WebDriver Selenium testing - Handle Elements in WebDriver
Selenium testing - Handle Elements in WebDriver
 
Selenium at Salesforce Scale
Selenium at Salesforce ScaleSelenium at Salesforce Scale
Selenium at Salesforce Scale
 
Salesforce selenium-saucelabs-webinar-april-2014
Salesforce selenium-saucelabs-webinar-april-2014Salesforce selenium-saucelabs-webinar-april-2014
Salesforce selenium-saucelabs-webinar-april-2014
 
Selenium
SeleniumSelenium
Selenium
 
Reliability as a Discipline
Reliability as a DisciplineReliability as a Discipline
Reliability as a Discipline
 
How EVERFI Moved from No Automation to Continuous Test Generation in 9 Months
How EVERFI Moved from No Automation to Continuous Test Generation in 9 MonthsHow EVERFI Moved from No Automation to Continuous Test Generation in 9 Months
How EVERFI Moved from No Automation to Continuous Test Generation in 9 Months
 

Mais de TechWell

Failing and Recovering
Failing and RecoveringFailing and Recovering
Failing and RecoveringTechWell
 
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 ArchitectureTechWell
 
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 StartTechWell
 
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 StrategyTechWell
 
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 SuccessTechWell
 
Implement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlowImplement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlowTechWell
 
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 SanityTechWell
 
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 StrategyTechWell
 
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 DevOpsTechWell
 
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—LeadershipTechWell
 
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 TeamsTechWell
 
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 GameTechWell
 
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 TeamsTechWell
 
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 ImplementationTechWell
 
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 ProcessTechWell
 
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 AutomateTechWell
 
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 SuccessTechWell
 
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 TransformationTechWell
 

Mais de 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
 

Último

Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 

Último (20)

Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 

Say Goodbye to Flaky Selenium Tests

  • 1.           T9   Test  Automation   10/5/17  11:15           Say  Goodbye  to  Flaky  Selenium  Tests     Presented  by:     Craig  Schwarzwald    Vanguard     Brought  to  you  by:                   350  Corporate  Way,  Suite  400,  Orange  Park,  FL  32073     888-­‐-­‐-­‐268-­‐-­‐-­‐8770  ·∙·∙  904-­‐-­‐-­‐278-­‐-­‐-­‐0524  -­‐  info@techwell.com  -­‐  http://www.starwest.techwell.com/                
  • 2. Craig  Schwarzwald   Vanguard     Craig  Schwarzwald  has  more  than  a  decade  of  professional  scripting  and   automation  experience.  For  the  past  six  years  he  has  focused  on  creating  and   maintaining  the  Selenium  framework  used  by  hundreds  of  testers,  developers,   and  automation  engineers  at  a  large  financial  organization.  Widely  regarded  as   his  company’s  Selenium  expert,  Craig  holds  weekly  ‰ÛÏoffice  hours‰Û   sessions  to  supply  solutions  to  teams’  most  difficult  Selenium-­‐based  challenges.   He  teaches  a  two-­‐day  Selenium  course  to  new  automation  engineers  looking  to   learn  Selenium.  In  his  spare  time,  Craig  enjoys  bowling,  playing  softball,  and   having  passionate  discussions  about  Selenium,  test  automation,  and  any  other   Shift  Left  related  topics.  Follow  Craig  on  Twitter  @AutomationCraig.    
  • 3. 1 Say Goodbye to Flaky Selenium Tests Craig Schwarzwald | Vanguard Craig_Schwarzwald@vanguard.com @AutomationCraig About Craig Schwarzwald ▪  Worked for Vanguard over 10 years ▪  Many different roles: ▪  System Tester, UI Developer, Mobile Developer, Automation Engineer ▪  Always focused on Automated Testing ▪  2007-2010: QTP ▪  2010-Present: Selenium ▪  Contributor to OCPSoft Blog ▪  Majority of the contents in this presentation can be found in my blog article: http://www.ocpsoft.org/opensource/flakiness-of-corporate-selenium-suites-and-how-to-get-rid-of-it/
  • 4. 2 Agenda Goal: Throughout The Entire Enterprise ▪ Stability ▪ Maintainability ▪ Readability
  • 5. 3 Stability Wait Strategies 1) Hard wait 2) Implicit Wait 3) Explicit Wait
  • 6. 4 Hard Wait Ex:  Thread.sleep(3000);         Implicit Wait Ex:  driver.manage().9meouts.implicitWait(3,  TimeUnit.SECONDS);        
  • 7. 5 Explicit Wait Ex:   WebDriverWait  wait  =  new  WebDriverWait(driver,  3);   Wait.un9l(ExpectedCondi9ons.elementToBeClickable(locator);       Maintainability
  • 8. 6 Issue: Poor Maintainability Solution: 1) Good locators 2) Page Objects What are good locators? 1) Unique 2) Descriptive 3) Unlikely to change
  • 9. 7 Issue: Bad Locators driver.findElement(By.xpath(“//div[34]/span[21]”  +      “/table/tbody/tr[17]/td[2]/input”)).click();     Solution: Use better ones By  con9nueBtn  =  By.id(“con9nueBuWon”);   click(con9nueBtn);   By  con9nueBtn  =  By.xpath(“//input[value=‘Con9nue’]”);   click(con9nueBtn);   or  if  there  is  no  ID:   Solution: Page Objects Construc9on:    -­‐  By  locators  pertaining  to  page/sec9on  on  top              -­‐  Constructor            -­‐  isLoaded()  method            -­‐  Finally  create  all  user  ac9on  methods  specific  to  that  page.  
  • 10. 8 Base Page Object ▪ Wraps Selenium core functionality ▪ findElement(),  click(),  isDisplayed(),  visit(),  etc. ▪ Also  add  common  func9ons  to  be  used  across  teams   ▪ getCellFromTableContainingText(byTable,  text);       ▪ selectWizzyWidget(value); Framework Base Page Corporate Base Page Readability
  • 11. 9 Rules to Follow Page Objects ▪  Contain all locators ▪  Contain methods for any actions you can do on the corresponding page / section of page. Rules to Follow Tests ▪  Perform assertion(s) ▪  Call page object methods to progress the tests. ▪  (Assign variables to make tests more readable)
  • 12. 10 Rules to Follow – The DON’Ts Page Objects DON’T: ▪  Make any assertions Tests DON’T: ▪  Refer to locators anywhere within the test NIETHER Page Objects NOR Tests: ▪  Call Selenium commands directly BONUS
  • 13. 11 Base Page Object Benefits ▪ Encapsulate all Selenium commands ▪ All  pages  get  auto-­‐enabled  func9onality   ▪ One  single  place  to  implement  all  the  null  checks,   failsafe’s,  and  logging.   ▪ No  more  NoSuchElementExcep9ons  or   StaleElementReferenceExcep9ons. Let’s look into the code!
  • 15. 13 Solution: Framework Code Solution: Corporate Override Example
  • 16. 14 Solution: Framework Code “Real World” Corporate Example
  • 17. 15 Corporate Example – Shopping Home (1 of 2) Corporate Example – Shopping Home (2 of 2)
  • 18. 16 Corporate Example – Buy Item Corporate Example – Confirm Page
  • 19. 17 Framework Code – Selenium Base Test Corporate Example – Selenium Test
  • 20. 18 Summary Summary – Achieve all 3 pillars 
 across our entire Enterprise ▪  Stability (Explicit Waits + Verifying Page Loads) ▪  Maintainability (Page Objects + Good Locators) ▪  Readability (Following Page Object and Test Rules) ▪  More details can be found on the blog post this talk was based on: http://www.ocpsoft.org/opensource/flakiness-of-corporate-selenium-suites-and-how-to-get-rid-of-it/ Craig_Schwarzwald@vanguard.com @AutomationCraig