SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Downloaden Sie, um offline zu lesen
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?

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 

Kürzlich hochgeladen (20)

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 

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.