TDD with functional testing using WebDriver Mikalai Alimenkou http://xpinjection.com 14.02.2012
Background • Java Technical Lead/Scrum Master at Zoral Labs • 7+ years in software development • 5+ years of working by Agile methodologies • Expert in Agile engineering practices • Founder and coach at XP Injection (http://xpinjection.com) • Organizer of Selenium Camp, JEEConf, XP Days Ukraine, IT Brunch conferences
When there are no problems nothing should be done LETS START WITH PROBLEMS!
Endless regression testing
Duplicated efforts on tests WebDriver Test = Test Case
Everybody do manual tests Developers QA engineer Customer
TDD is very simple concept but at the same is very hard to do TDD WITH WEBDRIVER
TDD is simple cycle
Acceptance TDD approach Automated Acceptance Acceptance Tests criteria Analysis Test Implementation Design Automated Acceptance Acceptance Tests criteria
WTF?!? Write tests before UI is ready? Impossible!!!
WebDriver test components Get Driver Use Driver Provide Data Use Locators
How to provide data? Customer Whole team Acceptance + Criteria Customer QA engineer Acceptance Behavior + Tests Samples Whole team Functional Unit Integration Tests Tests Tests
How to use locators? Discuss page Use mockup tools structure in details Developer HTML mockup starts from HTML from web designer
Locators team conventions Controls by ID Form elements by name Links by text List of items (semantic classes)
Natural test parts separation To enable reliable stable tests we need to separate all parts as much as possible Reliability Clarity Test Test Data Logic Flexibility Application Maintainability Driver Stability
Team can be balanced Customer QA engineer QA engineer + Test Test Data Logic Application Driver Developers QA engineer
DEMO TIME!
What about Page Object? search order Index Page Search Page login search filter Main Page open see more Details close Page show me like this
DEMO TIME!
TDD can not only solve current issues but bring you to the next level BENEFITS AND SUMMARY
Way to success is hard 1. Agree on team rules 2. Break your mind 3. Prepare to many issues 4. Relax in TDD environment
It is hard! What are the benefits?
Specify how IT MUST WORK, not how IT WORKS
Design with testability in mind No rework Less mistakes Strong guidelines Discuss design early Good Testable locators design Easier tests
Less technical tests Easy to Clear Readable maintain
Reduce manual checks
Clear Definition of Done @Ignore tests VS iteration test suite
Shared responsibility for testing is built
@xpinjection http://xpinjection.com mikalai.alimenkou@xpinjection.com

TDD in functional testing with WebDriver

  • 1.
    TDD with functionaltesting using WebDriver Mikalai Alimenkou http://xpinjection.com 14.02.2012
  • 2.
    Background • Java TechnicalLead/Scrum Master at Zoral Labs • 7+ years in software development • 5+ years of working by Agile methodologies • Expert in Agile engineering practices • Founder and coach at XP Injection (http://xpinjection.com) • Organizer of Selenium Camp, JEEConf, XP Days Ukraine, IT Brunch conferences
  • 3.
    When there areno problems nothing should be done LETS START WITH PROBLEMS!
  • 4.
  • 5.
    Duplicated efforts ontests WebDriver Test = Test Case
  • 6.
    Everybody do manualtests Developers QA engineer Customer
  • 7.
    TDD is verysimple concept but at the same is very hard to do TDD WITH WEBDRIVER
  • 8.
  • 9.
    Acceptance TDD approach Automated Acceptance Acceptance Tests criteria Analysis Test Implementation Design Automated Acceptance Acceptance Tests criteria
  • 10.
    WTF?!? Write tests before UI is ready? Impossible!!!
  • 11.
    WebDriver test components Get Driver Use Driver Provide Data Use Locators
  • 12.
    How to providedata? Customer Whole team Acceptance + Criteria Customer QA engineer Acceptance Behavior + Tests Samples Whole team Functional Unit Integration Tests Tests Tests
  • 13.
    How to uselocators? Discuss page Use mockup tools structure in details Developer HTML mockup starts from HTML from web designer
  • 14.
    Locators team conventions Controls by ID Form elements by name Links by text List of items (semantic classes)
  • 15.
    Natural test partsseparation To enable reliable stable tests we need to separate all parts as much as possible Reliability Clarity Test Test Data Logic Flexibility Application Maintainability Driver Stability
  • 16.
    Team can bebalanced Customer QA engineer QA engineer + Test Test Data Logic Application Driver Developers QA engineer
  • 17.
  • 18.
    What about PageObject? search order Index Page Search Page login search filter Main Page open see more Details close Page show me like this
  • 19.
  • 20.
    TDD can notonly solve current issues but bring you to the next level BENEFITS AND SUMMARY
  • 21.
    Way to successis hard 1. Agree on team rules 2. Break your mind 3. Prepare to many issues 4. Relax in TDD environment
  • 22.
    It is hard!What are the benefits?
  • 23.
    Specify how ITMUST WORK, not how IT WORKS
  • 24.
    Design with testabilityin mind No rework Less mistakes Strong guidelines Discuss design early Good Testable locators design Easier tests
  • 25.
    Less technical tests Easy to Clear Readable maintain
  • 26.
  • 27.
    Clear Definition ofDone @Ignore tests VS iteration test suite
  • 28.
    Shared responsibility fortesting is built
  • 29.
    @xpinjection http://xpinjection.com mikalai.alimenkou@xpinjection.com