SlideShare uma empresa Scribd logo
1 de 20
Baixar para ler offline
Using Selenium to Improve a Team's
        Development Cycle

                  Selenium Conference 2012
                  Mike Davis - Google
Background
Background


What is a Software Engineer in Test?



  "Engineer who does everything and anything to improve
  productivity and quality of Google products."
How Can Selenium Improve a Team's
Development Cycle?

The Objectives

 ●   Catch bugs before submission
 ●   Provide high confidence that system is working
 ●   Release faster & more often
 ●   Catch bugs not likely to be caught by manual QA
How Can Selenium Improve a Team's
Development Cycle?

The Strategy

 ●   Tests are written at the same time as features
 ●   Tests are run before every check-in
 ●   Code that breaks a test is not submitted
 ●   Tests run at all stages of the development process
How Can Selenium Improve a Team's
Development Cycle?

Some Corollaries

 ●   Tests must be run as much as possible
 ●   Developers must be involved in writing and maintaining tests
 ●   We need really good tests
What Makes Good Functional Tests?


        ● Fast & Stable
        ● Easy to run
        ● Easy to read
        ● Easy to debug
        ● Easy to write
What Makes Good Functional Tests?

Tests Must Run From a Single Command (Or IDE)

        ●   No "follow steps in this wiki"
        ●   No "first install this software"
        ●   No "Add yourself to this unix group"
        ●   No "First visit website and sign up a new user"
        ●   No command line flags




  Run this command & everything "just works"
What Makes Good Functional Tests?

Hermetic Tests

Hermetic:
 ● Self contained
 ● No external dependencies




Managing dependencies:
● Run them in-memory as well
● Look for in-memory implementations of data-stores
● Fake out dependencies that can't be brought up
What Makes Good Functional Tests?

Keep Tests Small / Limit Number of Tests

  Limit the number of tests:
   ● Do you really need this test?
   ● Is this already covered by unit tests?
   ● Can you write a unit test for this?




  Keep tests small:
   ● Can you make it 2 tests?
What Makes Good Functional Tests?

Tests Set Up All Data
 public void testUserHasOnePurchase() {
   AccountPage accountPage = loginPage.login("testUser1", "testPassword");
   assertEquals(1, accountPage.getPurchaseCount());
 }

  Example Failure 1:
               Exception: Expected <1> got <2>


  Example Failure 2:
               Exception: Login Failed
What Makes Good Functional Tests?

Errors Are Easy to Track Down
●   Assertions have useful error messages
              Exception : False line:225
         VS

              Exception : Expected User to Have Purchase

●   Supply Screenshots of Error States
                                                   Screenshot:


    Exception: Timed out locating element
    "By.id = SearchButton". A screenshot has
    been saved at http://screenshot/_Ghktyc
What Makes Good Functional Tests?
Errors Are Easy to Track Down
●     Misleading exceptions should be
      wrapped.

    Exception: Timed out locating element "By.id = BuyButton"


    Exception: Error page detected locating element "By.id = BuyButton"




●     Grab server side logs
    Exception: Error page detected locating element "By.id = BuyButton"
               ServerSide: NullPointerException @Purchase.java line 225
What Makes Good Functional Tests?

Example
 public class OrdersTest extends TestCase {
 ...
   public void setUp() {
     server = new LocalRunningServer();
     server.initialize();
     pathFinder = new PathFinder(server.getAddress());
  }

 public void testOrdersShowInAccount() {
   User user = userCreator.createNewUser();
   purchaser.makePurchaseForUser(user);

         HomePage homePage = pathFinder.getHomePage();
         LoginPage loginPage = homePage.navigateToLoginPage();
         UserDashboard userDashboard = loginPage.loginAs(user);
         OrdersPage ordersPage = userDashboard.navigateToMyOrders();

         assertEquals(1, ordersPage.getNumberOfOrders());
     }
 }
What Makes Good Functional Tests?

Counter Example
Bad                                                       Better
public class OrdersPage implements PageObject {       public class OrdersPage implements PageObject {
...                                                   ...
  public WebElement getOrder() {                        public String getOrderId() {
    if (!hasOrders()) {                                   assert(hasOrders(),
       createOrder();                                           "Expected orders but none found") ;
    }                                                     return driver.findElement("order").getText();
    return driver.findElement("order");                 }
  }
                                                          public List<String> getOrderIds() {
    public List<WebElement> getOrders() {                   ...
      return driver.findElements(By.name("order"));       }
    }                                                 }
}
Going Beyond
Going Beyond

Testing In-Memory Servers vs Deployed Servers
 Objective:
  ● Run tests at all stages of development cycle


 Problem:
  ● Priorities for Release Candidate are different
  ● Already have good suite of tests, don't want to
    write another
                                  Server




                         Local             Remote
                         Server            Server
Going Beyond

Profiling Tests
                                                                 Browser          Ajax        Server



             TestLoadHomePage() - Call Profile at Every Commit

                                                                           Key:
         3
No. of                                                                     GetHomePageData
Calls
                                                                           GetSpecialOffers
         2
                                                                           GetUserData

                                                                           AddToBasket
         1




                               History of Project
Summary

Using Selenium to Improve a Team's Development Cycle:

● Run tests as often as possible
● Get dev involved
● Good tests
  ○ Fast & Stable
  ○ Easy to run
  ○ Easy to read
  ○ Easy to debug
  ○ Easy to write

There are loads of ways to extend a good suite of tests.
Questions?

Mais conteúdo relacionado

Mais procurados

The Many Ways to Test Your React App
The Many Ways to Test Your React AppThe Many Ways to Test Your React App
The Many Ways to Test Your React AppAll Things Open
 
Exactpro Systems for KSTU Students in Kostroma
Exactpro Systems for KSTU Students in KostromaExactpro Systems for KSTU Students in Kostroma
Exactpro Systems for KSTU Students in KostromaIosif Itkin
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternBetter Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternSQALab
 
Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012Anton Arhipov
 
How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?Dmitry Buzdin
 
Automated Testing in Angular Slides
Automated Testing in Angular SlidesAutomated Testing in Angular Slides
Automated Testing in Angular SlidesJim Lynch
 
Acceptance Test-driven Development with Cucumber-jvm
Acceptance Test-driven Development with Cucumber-jvmAcceptance Test-driven Development with Cucumber-jvm
Acceptance Test-driven Development with Cucumber-jvmChristopher Bartling
 
Continuous integration using thucydides(bdd) with selenium
Continuous integration using thucydides(bdd) with seleniumContinuous integration using thucydides(bdd) with selenium
Continuous integration using thucydides(bdd) with seleniumXebia IT Architects
 
Jest: Frontend Testing leicht gemacht @EnterJS2018
Jest: Frontend Testing leicht gemacht @EnterJS2018Jest: Frontend Testing leicht gemacht @EnterJS2018
Jest: Frontend Testing leicht gemacht @EnterJS2018Holger Grosse-Plankermann
 
Selenium RC: Automated Testing of Modern Web Applications
Selenium RC: Automated Testing of Modern Web ApplicationsSelenium RC: Automated Testing of Modern Web Applications
Selenium RC: Automated Testing of Modern Web Applicationsqooxdoo
 
Easy tests with Selenide and Easyb
Easy tests with Selenide and EasybEasy tests with Selenide and Easyb
Easy tests with Selenide and EasybIakiv Kramarenko
 
Protractor Tutorial Quality in Agile 2015
Protractor Tutorial Quality in Agile 2015Protractor Tutorial Quality in Agile 2015
Protractor Tutorial Quality in Agile 2015Andrew Eisenberg
 
AngularJS Unit Test
AngularJS Unit TestAngularJS Unit Test
AngularJS Unit TestChiew Carol
 
Apex Testing and Best Practices
Apex Testing and Best PracticesApex Testing and Best Practices
Apex Testing and Best PracticesJitendra Zaa
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberKMS Technology
 
Testing for fun in production Into The Box 2018
Testing for fun in production Into The Box 2018Testing for fun in production Into The Box 2018
Testing for fun in production Into The Box 2018Ortus Solutions, Corp
 
Testing in AngularJS
Testing in AngularJSTesting in AngularJS
Testing in AngularJSPeter Drinnan
 

Mais procurados (20)

The Many Ways to Test Your React App
The Many Ways to Test Your React AppThe Many Ways to Test Your React App
The Many Ways to Test Your React App
 
Learn SoapUI
Learn SoapUILearn SoapUI
Learn SoapUI
 
Exactpro Systems for KSTU Students in Kostroma
Exactpro Systems for KSTU Students in KostromaExactpro Systems for KSTU Students in Kostroma
Exactpro Systems for KSTU Students in Kostroma
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternBetter Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component Pattern
 
Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012
 
How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?
 
Behavior Driven Development Testing (BDD)
Behavior Driven Development Testing (BDD)Behavior Driven Development Testing (BDD)
Behavior Driven Development Testing (BDD)
 
Automated Testing in Angular Slides
Automated Testing in Angular SlidesAutomated Testing in Angular Slides
Automated Testing in Angular Slides
 
Acceptance Test-driven Development with Cucumber-jvm
Acceptance Test-driven Development with Cucumber-jvmAcceptance Test-driven Development with Cucumber-jvm
Acceptance Test-driven Development with Cucumber-jvm
 
Continuous integration using thucydides(bdd) with selenium
Continuous integration using thucydides(bdd) with seleniumContinuous integration using thucydides(bdd) with selenium
Continuous integration using thucydides(bdd) with selenium
 
Jest: Frontend Testing leicht gemacht @EnterJS2018
Jest: Frontend Testing leicht gemacht @EnterJS2018Jest: Frontend Testing leicht gemacht @EnterJS2018
Jest: Frontend Testing leicht gemacht @EnterJS2018
 
Selenium RC: Automated Testing of Modern Web Applications
Selenium RC: Automated Testing of Modern Web ApplicationsSelenium RC: Automated Testing of Modern Web Applications
Selenium RC: Automated Testing of Modern Web Applications
 
Integration testing - A&BP CC
Integration testing - A&BP CCIntegration testing - A&BP CC
Integration testing - A&BP CC
 
Easy tests with Selenide and Easyb
Easy tests with Selenide and EasybEasy tests with Selenide and Easyb
Easy tests with Selenide and Easyb
 
Protractor Tutorial Quality in Agile 2015
Protractor Tutorial Quality in Agile 2015Protractor Tutorial Quality in Agile 2015
Protractor Tutorial Quality in Agile 2015
 
AngularJS Unit Test
AngularJS Unit TestAngularJS Unit Test
AngularJS Unit Test
 
Apex Testing and Best Practices
Apex Testing and Best PracticesApex Testing and Best Practices
Apex Testing and Best Practices
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using Cucumber
 
Testing for fun in production Into The Box 2018
Testing for fun in production Into The Box 2018Testing for fun in production Into The Box 2018
Testing for fun in production Into The Box 2018
 
Testing in AngularJS
Testing in AngularJSTesting in AngularJS
Testing in AngularJS
 

Destaque

Introducing Selenium Builder – the Future of Test Development
Introducing Selenium Builder – the Future of Test DevelopmentIntroducing Selenium Builder – the Future of Test Development
Introducing Selenium Builder – the Future of Test Developmentseleniumconf
 
Automatic Test Case Generation
Automatic Test Case GenerationAutomatic Test Case Generation
Automatic Test Case GenerationAdnan Causevic
 
The story of language development
The story of language developmentThe story of language development
The story of language developmentHiroshi SHIBATA
 
Automated Test Case Generation and Execution from Models
Automated Test Case Generation and Execution from ModelsAutomated Test Case Generation and Execution from Models
Automated Test Case Generation and Execution from ModelsDharmalingam Ganesan
 
TMPA-2017: A Survey on Model-Based Testing Tools for Test Case Generation
TMPA-2017: A Survey on Model-Based Testing Tools for Test Case GenerationTMPA-2017: A Survey on Model-Based Testing Tools for Test Case Generation
TMPA-2017: A Survey on Model-Based Testing Tools for Test Case GenerationIosif Itkin
 

Destaque (6)

Introducing Selenium Builder – the Future of Test Development
Introducing Selenium Builder – the Future of Test DevelopmentIntroducing Selenium Builder – the Future of Test Development
Introducing Selenium Builder – the Future of Test Development
 
Automatic Test Case Generation
Automatic Test Case GenerationAutomatic Test Case Generation
Automatic Test Case Generation
 
The story of language development
The story of language developmentThe story of language development
The story of language development
 
Automated Test Case Generation and Execution from Models
Automated Test Case Generation and Execution from ModelsAutomated Test Case Generation and Execution from Models
Automated Test Case Generation and Execution from Models
 
TMPA-2017: A Survey on Model-Based Testing Tools for Test Case Generation
TMPA-2017: A Survey on Model-Based Testing Tools for Test Case GenerationTMPA-2017: A Survey on Model-Based Testing Tools for Test Case Generation
TMPA-2017: A Survey on Model-Based Testing Tools for Test Case Generation
 
[HCMC STC Jan 2015] FATS: A Framework For Automated Testing Scenarios
[HCMC STC Jan 2015] FATS: A Framework For Automated Testing Scenarios[HCMC STC Jan 2015] FATS: A Framework For Automated Testing Scenarios
[HCMC STC Jan 2015] FATS: A Framework For Automated Testing Scenarios
 

Semelhante a Using Selenium to Improve a Teams Development Cycle

Top100summit 谷歌-scott-improve your automated web application testing
Top100summit  谷歌-scott-improve your automated web application testingTop100summit  谷歌-scott-improve your automated web application testing
Top100summit 谷歌-scott-improve your automated web application testingdrewz lin
 
Testing ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NETTesting ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NETBen Hall
 
Selenium withnet
Selenium withnetSelenium withnet
Selenium withnetVlad Maniak
 
Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Lars Thorup
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with seleniumTzirla Rozental
 
Automated acceptance test
Automated acceptance testAutomated acceptance test
Automated acceptance testBryan Liu
 
Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Improving Your Selenium WebDriver Tests - Belgium testing days_2016Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Improving Your Selenium WebDriver Tests - Belgium testing days_2016Roy de Kleijn
 
Escape from the automation hell
Escape from the automation hellEscape from the automation hell
Escape from the automation hellNikita Simonovets
 
Testing Ext JS and Sencha Touch
Testing Ext JS and Sencha TouchTesting Ext JS and Sencha Touch
Testing Ext JS and Sencha TouchMats Bryntse
 
UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018
UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018
UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018Tobias Schneck
 
Web UI test automation instruments
Web UI test automation instrumentsWeb UI test automation instruments
Web UI test automation instrumentsArtem Nagornyi
 
Workshop quality assurance for php projects - phpdublin
Workshop quality assurance for php projects - phpdublinWorkshop quality assurance for php projects - phpdublin
Workshop quality assurance for php projects - phpdublinMichelangelo van Dam
 
Test Driven Development with JavaFX
Test Driven Development with JavaFXTest Driven Development with JavaFX
Test Driven Development with JavaFXHendrik Ebbers
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersJavan Rasokat
 
Writing better tests for your java script app
Writing better tests for your java script appWriting better tests for your java script app
Writing better tests for your java script appJakeGinnivan
 
UI Testing - Selenium? Rich-Clients? Containers? (SwanseaCon 2018)
UI Testing - Selenium? Rich-Clients? Containers? (SwanseaCon 2018)UI Testing - Selenium? Rich-Clients? Containers? (SwanseaCon 2018)
UI Testing - Selenium? Rich-Clients? Containers? (SwanseaCon 2018)Tobias Schneck
 
Михаил Боднарчук "Acceptance Testing in NodeJS: Tools & Approaches"
Михаил Боднарчук "Acceptance Testing in NodeJS: Tools & Approaches"Михаил Боднарчук "Acceptance Testing in NodeJS: Tools & Approaches"
Михаил Боднарчук "Acceptance Testing in NodeJS: Tools & Approaches"Fwdays
 
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan KuštInfinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan KuštInfinum
 

Semelhante a Using Selenium to Improve a Teams Development Cycle (20)

Top100summit 谷歌-scott-improve your automated web application testing
Top100summit  谷歌-scott-improve your automated web application testingTop100summit  谷歌-scott-improve your automated web application testing
Top100summit 谷歌-scott-improve your automated web application testing
 
Testing ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NETTesting ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NET
 
Selenium withnet
Selenium withnetSelenium withnet
Selenium withnet
 
Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with selenium
 
Automated acceptance test
Automated acceptance testAutomated acceptance test
Automated acceptance test
 
Selenium
SeleniumSelenium
Selenium
 
Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Improving Your Selenium WebDriver Tests - Belgium testing days_2016Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Improving Your Selenium WebDriver Tests - Belgium testing days_2016
 
Escape from the automation hell
Escape from the automation hellEscape from the automation hell
Escape from the automation hell
 
Testing Ext JS and Sencha Touch
Testing Ext JS and Sencha TouchTesting Ext JS and Sencha Touch
Testing Ext JS and Sencha Touch
 
UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018
UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018
UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018
 
Web UI test automation instruments
Web UI test automation instrumentsWeb UI test automation instruments
Web UI test automation instruments
 
Workshop quality assurance for php projects - phpdublin
Workshop quality assurance for php projects - phpdublinWorkshop quality assurance for php projects - phpdublin
Workshop quality assurance for php projects - phpdublin
 
Test Driven Development with JavaFX
Test Driven Development with JavaFXTest Driven Development with JavaFX
Test Driven Development with JavaFX
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA Testers
 
Writing better tests for your java script app
Writing better tests for your java script appWriting better tests for your java script app
Writing better tests for your java script app
 
UI Testing - Selenium? Rich-Clients? Containers? (SwanseaCon 2018)
UI Testing - Selenium? Rich-Clients? Containers? (SwanseaCon 2018)UI Testing - Selenium? Rich-Clients? Containers? (SwanseaCon 2018)
UI Testing - Selenium? Rich-Clients? Containers? (SwanseaCon 2018)
 
Continuous feature-development
Continuous feature-developmentContinuous feature-development
Continuous feature-development
 
Михаил Боднарчук "Acceptance Testing in NodeJS: Tools & Approaches"
Михаил Боднарчук "Acceptance Testing in NodeJS: Tools & Approaches"Михаил Боднарчук "Acceptance Testing in NodeJS: Tools & Approaches"
Михаил Боднарчук "Acceptance Testing in NodeJS: Tools & Approaches"
 
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan KuštInfinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
 

Mais de seleniumconf

More Than Automation - How Good Acceptance Tests Can Make Your Team Happier
More Than Automation - How Good Acceptance Tests Can Make Your Team HappierMore Than Automation - How Good Acceptance Tests Can Make Your Team Happier
More Than Automation - How Good Acceptance Tests Can Make Your Team Happierseleniumconf
 
Building a Selenium Community One Meetup at a Time
Building a Selenium Community One Meetup at a TimeBuilding a Selenium Community One Meetup at a Time
Building a Selenium Community One Meetup at a Timeseleniumconf
 
Introduction to selenium_grid_workshop
Introduction to selenium_grid_workshopIntroduction to selenium_grid_workshop
Introduction to selenium_grid_workshopseleniumconf
 
Automated Security Testing
Automated Security TestingAutomated Security Testing
Automated Security Testingseleniumconf
 
Selenium: State of the Union
Selenium: State of the UnionSelenium: State of the Union
Selenium: State of the Unionseleniumconf
 
Automated Web App Performance Testing Using WebDriver
Automated Web App Performance Testing Using WebDriverAutomated Web App Performance Testing Using WebDriver
Automated Web App Performance Testing Using WebDriverseleniumconf
 
Building a Driver: Lessons Learned From Developing the Internet Explorer Driver
Building a Driver: Lessons Learned From Developing the Internet Explorer DriverBuilding a Driver: Lessons Learned From Developing the Internet Explorer Driver
Building a Driver: Lessons Learned From Developing the Internet Explorer Driverseleniumconf
 
Massively Continuous Integration: From 3 days to 30 minutes
Massively Continuous Integration: From 3 days to 30 minutesMassively Continuous Integration: From 3 days to 30 minutes
Massively Continuous Integration: From 3 days to 30 minutesseleniumconf
 

Mais de seleniumconf (8)

More Than Automation - How Good Acceptance Tests Can Make Your Team Happier
More Than Automation - How Good Acceptance Tests Can Make Your Team HappierMore Than Automation - How Good Acceptance Tests Can Make Your Team Happier
More Than Automation - How Good Acceptance Tests Can Make Your Team Happier
 
Building a Selenium Community One Meetup at a Time
Building a Selenium Community One Meetup at a TimeBuilding a Selenium Community One Meetup at a Time
Building a Selenium Community One Meetup at a Time
 
Introduction to selenium_grid_workshop
Introduction to selenium_grid_workshopIntroduction to selenium_grid_workshop
Introduction to selenium_grid_workshop
 
Automated Security Testing
Automated Security TestingAutomated Security Testing
Automated Security Testing
 
Selenium: State of the Union
Selenium: State of the UnionSelenium: State of the Union
Selenium: State of the Union
 
Automated Web App Performance Testing Using WebDriver
Automated Web App Performance Testing Using WebDriverAutomated Web App Performance Testing Using WebDriver
Automated Web App Performance Testing Using WebDriver
 
Building a Driver: Lessons Learned From Developing the Internet Explorer Driver
Building a Driver: Lessons Learned From Developing the Internet Explorer DriverBuilding a Driver: Lessons Learned From Developing the Internet Explorer Driver
Building a Driver: Lessons Learned From Developing the Internet Explorer Driver
 
Massively Continuous Integration: From 3 days to 30 minutes
Massively Continuous Integration: From 3 days to 30 minutesMassively Continuous Integration: From 3 days to 30 minutes
Massively Continuous Integration: From 3 days to 30 minutes
 

Último

Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 

Último (20)

Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 

Using Selenium to Improve a Teams Development Cycle

  • 1. Using Selenium to Improve a Team's Development Cycle Selenium Conference 2012 Mike Davis - Google
  • 3. Background What is a Software Engineer in Test? "Engineer who does everything and anything to improve productivity and quality of Google products."
  • 4. How Can Selenium Improve a Team's Development Cycle? The Objectives ● Catch bugs before submission ● Provide high confidence that system is working ● Release faster & more often ● Catch bugs not likely to be caught by manual QA
  • 5. How Can Selenium Improve a Team's Development Cycle? The Strategy ● Tests are written at the same time as features ● Tests are run before every check-in ● Code that breaks a test is not submitted ● Tests run at all stages of the development process
  • 6. How Can Selenium Improve a Team's Development Cycle? Some Corollaries ● Tests must be run as much as possible ● Developers must be involved in writing and maintaining tests ● We need really good tests
  • 7. What Makes Good Functional Tests? ● Fast & Stable ● Easy to run ● Easy to read ● Easy to debug ● Easy to write
  • 8. What Makes Good Functional Tests? Tests Must Run From a Single Command (Or IDE) ● No "follow steps in this wiki" ● No "first install this software" ● No "Add yourself to this unix group" ● No "First visit website and sign up a new user" ● No command line flags Run this command & everything "just works"
  • 9. What Makes Good Functional Tests? Hermetic Tests Hermetic: ● Self contained ● No external dependencies Managing dependencies: ● Run them in-memory as well ● Look for in-memory implementations of data-stores ● Fake out dependencies that can't be brought up
  • 10. What Makes Good Functional Tests? Keep Tests Small / Limit Number of Tests Limit the number of tests: ● Do you really need this test? ● Is this already covered by unit tests? ● Can you write a unit test for this? Keep tests small: ● Can you make it 2 tests?
  • 11. What Makes Good Functional Tests? Tests Set Up All Data public void testUserHasOnePurchase() { AccountPage accountPage = loginPage.login("testUser1", "testPassword"); assertEquals(1, accountPage.getPurchaseCount()); } Example Failure 1: Exception: Expected <1> got <2> Example Failure 2: Exception: Login Failed
  • 12. What Makes Good Functional Tests? Errors Are Easy to Track Down ● Assertions have useful error messages Exception : False line:225 VS Exception : Expected User to Have Purchase ● Supply Screenshots of Error States Screenshot: Exception: Timed out locating element "By.id = SearchButton". A screenshot has been saved at http://screenshot/_Ghktyc
  • 13. What Makes Good Functional Tests? Errors Are Easy to Track Down ● Misleading exceptions should be wrapped. Exception: Timed out locating element "By.id = BuyButton" Exception: Error page detected locating element "By.id = BuyButton" ● Grab server side logs Exception: Error page detected locating element "By.id = BuyButton" ServerSide: NullPointerException @Purchase.java line 225
  • 14. What Makes Good Functional Tests? Example public class OrdersTest extends TestCase { ... public void setUp() { server = new LocalRunningServer(); server.initialize(); pathFinder = new PathFinder(server.getAddress()); } public void testOrdersShowInAccount() { User user = userCreator.createNewUser(); purchaser.makePurchaseForUser(user); HomePage homePage = pathFinder.getHomePage(); LoginPage loginPage = homePage.navigateToLoginPage(); UserDashboard userDashboard = loginPage.loginAs(user); OrdersPage ordersPage = userDashboard.navigateToMyOrders(); assertEquals(1, ordersPage.getNumberOfOrders()); } }
  • 15. What Makes Good Functional Tests? Counter Example Bad Better public class OrdersPage implements PageObject { public class OrdersPage implements PageObject { ... ... public WebElement getOrder() { public String getOrderId() { if (!hasOrders()) { assert(hasOrders(), createOrder(); "Expected orders but none found") ; } return driver.findElement("order").getText(); return driver.findElement("order"); } } public List<String> getOrderIds() { public List<WebElement> getOrders() { ... return driver.findElements(By.name("order")); } } } }
  • 17. Going Beyond Testing In-Memory Servers vs Deployed Servers Objective: ● Run tests at all stages of development cycle Problem: ● Priorities for Release Candidate are different ● Already have good suite of tests, don't want to write another Server Local Remote Server Server
  • 18. Going Beyond Profiling Tests Browser Ajax Server TestLoadHomePage() - Call Profile at Every Commit Key: 3 No. of GetHomePageData Calls GetSpecialOffers 2 GetUserData AddToBasket 1 History of Project
  • 19. Summary Using Selenium to Improve a Team's Development Cycle: ● Run tests as often as possible ● Get dev involved ● Good tests ○ Fast & Stable ○ Easy to run ○ Easy to read ○ Easy to debug ○ Easy to write There are loads of ways to extend a good suite of tests.