SlideShare a Scribd company logo
1 of 44
DSL, Page Object and WebDriver –
the path to reliable functional tests
          Mikalai Alimenkou
        http://xpinjection.com
              06.10.2011
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
• Agile coach (TDD, Testing, Planning, etc.)
  at XP Injection (http://xpinjection.com)
• Organizer of Selenium Camp, JEEConf and
  XP Days Ukraine conferences
Agenda
•   WebDriver tests issues
•   Step 1: DSL introduction
•   Step 2: Page Object pattern
•   Step 3: Page Element pattern
•   Results analysis
When you have a hammer, everything looks like a nail

WEBDRIVER TESTS ISSUES
Test Components

Application                 Test
  Driver                    Data




                     Test
                    Logic
How WebDriver Works?
                     Get Driver




   Invoke Commands

                           Provide Data




                          Use Locators
Selenium Tests Issues: Verbose
 By.xpath(“//input*@value=‘continue’+”)

                                          driver.findElement(By.xpath(…)).sendKeys(…);

driver.findElement(By.name(…)).click();
                                By.css(“#results dip p.first”)
    By.id(“greenButton”)
                           driver.findElements(…).size();

 new WebDriverWait(driver, 30).until(…);
Selenium Tests Issues: Not Expressive
Selenium Tests Issues: Unreadable
Selenium Tests Issues: Fragile
driver.findElement(By.xpath("//input[@id=(//label[tex
t()='Fax']/@for)]")).click();

                                    What is going on here?



driver.findElement(By.xpath("//div[@id='App']/div/p[4]/di
v[1]/h4[@class='Online']")).getText()

          Depends too much on
            page structure!
Even More Hidden Issues
                  Test code
                 duplication
      Hard to
    understand                 No reuse



Fewer tests                        Hard to
  created                          support



     Hard to                   Test wrong
   create new                    things

                 Performance
                  problems
What is the Primary Goal?
 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
Ideal Testing Framework

       Test Logic            Test Data
                              Storage


 DSL Application Driver



    Technical Driver         Technical
                            Data Storage


Application Under Testing
Create domain-specific language for your application

STEP 1: INTRODUCE DSL
Definition of DSL

    A domain-specific language (DSL) is a
   programming language or specification
language dedicated to a particular problem
domain, that is created specifically to solve
  problems in this particular domain and is
 not intended to be able to solve problems
outside it (although that may be technically
                  possible).
DSL Usage Sample
DEMO
Benefits of DSL Approach
• High-level – tests are in the language of
  product management, at the user level
• Readable – product management can
  understand them
• Writable – easy for developer or QA to write
  new test
• Extensible – tests base is able to grow with
  DSL
Tips and Tricks
• Use test class hierarchy or test helpers
• Use builders, visitors and other design
  patterns
• Reuse domain model from application
• Some common methods move to base test
  class
• Minimize usage of driver instance in tests
Create page map for your application

STEP 2: INTRODUCE PAGE OBJECT
Page Object Pattern
              search                     order
Index
 Page

                              Search
                               Page
login
            search
                                       filter
Main
Page                   open


                                   see more
               Details
  close         Page
                                                 show me like this
Test Architecture with Page Object
Components Architecture
Isolated                     Concepts
  logic                     separation




  Easier
 support                     Simplicity
Ways to Implement Page Object
                      Duplicate Site Map
                      with Packages and
                            Classes




Move Site Structure
  to UI-Element
WebDriver Page Object Support
DEMO
“Ideal” Page Object in WebDriver
Tips and Tricks
• Allow chain invocations
• Basic page with driver details and common
  methods
• Use already included Page Object classes to
  simplify pages creation
• Expose only what is allowed to see or do on the
  page
• Don’t use driver instance in tests at all
• Use static analysis to check rules
• Use site map to prepare Page Objects
Divide pages on reusable elements

STEP 3: PAGE ELEMENTS
Page Consists of Elements
                                 Menu




                    Checkbox            Panel

Link




List of Items
Different Page Elements
     Checkbox                 TextBox                Button

•   click               •   type              •   click
•   isChecked           •   hasValue          •   doubleClick
•   check               •   focus             •   clickAndWait
•   uncheck             •   clearText         •   …
•   …                   •   typeAndReturn
                        •   isEditable
                        •   …




Table           Items        Menu           Panel       Form
Why Page Element Pattern?

       Highest
                  Clear page
       level of
                   structure
     code reuse




      Building
                   Reliable
     pages from
                    tests
    components
Inversion of Control

Hides the details of
browser communication                After

     Before



                           Expose methods for what
                                test can see and do
DEMO
Tellurium Project
Tellurium Basics: UI Module
              Groovy File
                                  Can Build XPath in
                                      Runtime


   All
Elements
           Element UID                  Isolated
                                        Locators

                            Available
                             Actions
Tellurium Basics: UI Object
• uid – unique in UI module
• namespace – for future extension
• locator – locator of the UI object
  – A base locator (relative XPath)
  – A composite locator (object attributes)
• group – applied to some kinds of UI objects to
  switch on grouping locating
• respond – define JavaScript events the UI object
  could respond to
• some basic methods – isElementPresent,
  isVisible, isDisabled, waitForElementPresent,
  getText, mouseOver, mouseOut, getAttribute
Tellurium IDE and TrUMP
DEMO
Tips and Tricks
•   Create elements when first need them
•   Review and improve elements continuously
•   Isolate and hide hacks inside elements
•   Use open source libraries as basis
•   Use annotations and other metadata
    techniques to simplify creation
What we have at the end of long way?

RESULTS ANALYSIS
Long Path Bring Us to…
•   Reliable tests
•   Reusable test code
•   Separation of concepts
•   Expressive tested UI structure
•   Short and clear tests
•   Tests look more like acceptance tests
•   Tests are understood by non-technical people
Company DSL Library
Components may be reused between different
 applications and projects inside a company

   Company                          AJAX
    Portal                       Components



  Online Store                      Basic
                                 Components

   Customer
    Service                         JSF
                                 Components
@xpinjection
             http://xpinjection.com
mikalai.alimenkou@xpinjection.com

More Related Content

What's hot

Using The Page Object Pattern
Using The Page Object PatternUsing The Page Object Pattern
Using The Page Object PatternDante Briones
 
SpecFlow and some things I've picked up
SpecFlow and some things I've picked upSpecFlow and some things I've picked up
SpecFlow and some things I've picked upMarcus Hammarberg
 
Mastering UI automation at Scale: Key Lessons and Best Practices (By Fernando...
Mastering UI automation at Scale: Key Lessons and Best Practices (By Fernando...Mastering UI automation at Scale: Key Lessons and Best Practices (By Fernando...
Mastering UI automation at Scale: Key Lessons and Best Practices (By Fernando...Applitools
 
[Webinar] Continuous Testing Done Right: Test Automation at the World's Leadi...
[Webinar] Continuous Testing Done Right: Test Automation at the World's Leadi...[Webinar] Continuous Testing Done Right: Test Automation at the World's Leadi...
[Webinar] Continuous Testing Done Right: Test Automation at the World's Leadi...Applitools
 
Test automation expert days
Test automation   expert daysTest automation   expert days
Test automation expert daysOren Rubin
 
Making cross browser tests beautiful
Making cross browser tests beautifulMaking cross browser tests beautiful
Making cross browser tests beautifulMeaghan Lewis
 
Automated UI Testing Done Right (QMSDNUG)
Automated UI Testing Done Right (QMSDNUG)Automated UI Testing Done Right (QMSDNUG)
Automated UI Testing Done Right (QMSDNUG)Mehdi Khalili
 
Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully Applitools
 
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 PatternSargis Sargsyan
 
Behaviour driven development aka bdd
Behaviour driven development aka bddBehaviour driven development aka bdd
Behaviour driven development aka bddPrince Gupta
 
Stepin evening presented
Stepin evening presentedStepin evening presented
Stepin evening presentedVijayan Reddy
 
UI Testing Automation
UI Testing AutomationUI Testing Automation
UI Testing AutomationAgileEngine
 
Automated Acceptance Tests in .NET
Automated Acceptance Tests in .NETAutomated Acceptance Tests in .NET
Automated Acceptance Tests in .NETWyn B. Van Devanter
 
Refactoring page objects The Screenplay Pattern
Refactoring page objects   The Screenplay Pattern Refactoring page objects   The Screenplay Pattern
Refactoring page objects The Screenplay Pattern RiverGlide
 
Brace yourself from automation death trap
Brace yourself from automation death trapBrace yourself from automation death trap
Brace yourself from automation death trapPrasad Kalgutkar
 
Automated UI testing done right (DDDSydney)
Automated UI testing done right (DDDSydney)Automated UI testing done right (DDDSydney)
Automated UI testing done right (DDDSydney)Mehdi Khalili
 
Angular UI Testing with Protractor
Angular UI Testing with ProtractorAngular UI Testing with Protractor
Angular UI Testing with ProtractorAndrew Eisenberg
 
Getting Started with Selenium
Getting Started with SeleniumGetting Started with Selenium
Getting Started with SeleniumDave Haeffner
 
Introduction To Web Application Testing
Introduction To Web Application TestingIntroduction To Web Application Testing
Introduction To Web Application TestingYnon Perek
 

What's hot (20)

Using The Page Object Pattern
Using The Page Object PatternUsing The Page Object Pattern
Using The Page Object Pattern
 
SpecFlow and some things I've picked up
SpecFlow and some things I've picked upSpecFlow and some things I've picked up
SpecFlow and some things I've picked up
 
Mastering UI automation at Scale: Key Lessons and Best Practices (By Fernando...
Mastering UI automation at Scale: Key Lessons and Best Practices (By Fernando...Mastering UI automation at Scale: Key Lessons and Best Practices (By Fernando...
Mastering UI automation at Scale: Key Lessons and Best Practices (By Fernando...
 
[Webinar] Continuous Testing Done Right: Test Automation at the World's Leadi...
[Webinar] Continuous Testing Done Right: Test Automation at the World's Leadi...[Webinar] Continuous Testing Done Right: Test Automation at the World's Leadi...
[Webinar] Continuous Testing Done Right: Test Automation at the World's Leadi...
 
Test automation expert days
Test automation   expert daysTest automation   expert days
Test automation expert days
 
Marcin Wasilczyk - Page objects with selenium
Marcin Wasilczyk - Page objects with seleniumMarcin Wasilczyk - Page objects with selenium
Marcin Wasilczyk - Page objects with selenium
 
Making cross browser tests beautiful
Making cross browser tests beautifulMaking cross browser tests beautiful
Making cross browser tests beautiful
 
Automated UI Testing Done Right (QMSDNUG)
Automated UI Testing Done Right (QMSDNUG)Automated UI Testing Done Right (QMSDNUG)
Automated UI Testing Done Right (QMSDNUG)
 
Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully
 
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
 
Behaviour driven development aka bdd
Behaviour driven development aka bddBehaviour driven development aka bdd
Behaviour driven development aka bdd
 
Stepin evening presented
Stepin evening presentedStepin evening presented
Stepin evening presented
 
UI Testing Automation
UI Testing AutomationUI Testing Automation
UI Testing Automation
 
Automated Acceptance Tests in .NET
Automated Acceptance Tests in .NETAutomated Acceptance Tests in .NET
Automated Acceptance Tests in .NET
 
Refactoring page objects The Screenplay Pattern
Refactoring page objects   The Screenplay Pattern Refactoring page objects   The Screenplay Pattern
Refactoring page objects The Screenplay Pattern
 
Brace yourself from automation death trap
Brace yourself from automation death trapBrace yourself from automation death trap
Brace yourself from automation death trap
 
Automated UI testing done right (DDDSydney)
Automated UI testing done right (DDDSydney)Automated UI testing done right (DDDSydney)
Automated UI testing done right (DDDSydney)
 
Angular UI Testing with Protractor
Angular UI Testing with ProtractorAngular UI Testing with Protractor
Angular UI Testing with Protractor
 
Getting Started with Selenium
Getting Started with SeleniumGetting Started with Selenium
Getting Started with Selenium
 
Introduction To Web Application Testing
Introduction To Web Application TestingIntroduction To Web Application Testing
Introduction To Web Application Testing
 

Viewers also liked

TDD in functional testing with WebDriver
TDD in functional testing with WebDriverTDD in functional testing with WebDriver
TDD in functional testing with WebDriverMikalai Alimenkou
 
10 things about BDD, Cucumber and SpecFlow - Long Version 2016
10 things about BDD, Cucumber and SpecFlow - Long Version 201610 things about BDD, Cucumber and SpecFlow - Long Version 2016
10 things about BDD, Cucumber and SpecFlow - Long Version 2016Seb Rose
 
A journey beyond the page object pattern
A journey beyond the page object patternA journey beyond the page object pattern
A journey beyond the page object patternRiverGlide
 
Do you know what you are testing?
Do you know what you are testing?Do you know what you are testing?
Do you know what you are testing?Mikalai Alimenkou
 
Development without Testers: Myth or Real Option?
Development without Testers: Myth or Real Option?Development without Testers: Myth or Real Option?
Development without Testers: Myth or Real Option?Mikalai Alimenkou
 
How to Use Selenium, Successfully
How to Use Selenium, SuccessfullyHow to Use Selenium, Successfully
How to Use Selenium, SuccessfullySauce Labs
 
Бытовая классификация тестировщиков с точки зрения разработчика
Бытовая классификация тестировщиков с точки зрения разработчикаБытовая классификация тестировщиков с точки зрения разработчика
Бытовая классификация тестировщиков с точки зрения разработчикаMikalai Alimenkou
 
Webium: Page Objects In Python (Eng)
Webium: Page Objects In Python (Eng)Webium: Page Objects In Python (Eng)
Webium: Page Objects In Python (Eng)Uladzimir Franskevich
 
How to Design a Successful Test Automation Strategy
How to Design a Successful Test Automation Strategy How to Design a Successful Test Automation Strategy
How to Design a Successful Test Automation Strategy Impetus Technologies
 
Automated Testing vs Manual Testing
Automated Testing vs Manual TestingAutomated Testing vs Manual Testing
Automated Testing vs Manual TestingDirecti Group
 
Test Automation Framework Design | www.idexcel.com
Test Automation Framework Design | www.idexcel.comTest Automation Framework Design | www.idexcel.com
Test Automation Framework Design | www.idexcel.comIdexcel Technologies
 
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
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven DevelopmentLiz Keogh
 
Introduction to Test Automation - Technology and Tools
Introduction to Test Automation - Technology and ToolsIntroduction to Test Automation - Technology and Tools
Introduction to Test Automation - Technology and ToolsKMS Technology
 
Introduction to Test Automation
Introduction to Test AutomationIntroduction to Test Automation
Introduction to Test AutomationPekka Klärck
 
Node.js and Selenium Webdriver, a journey from the Java side
Node.js and Selenium Webdriver, a journey from the Java sideNode.js and Selenium Webdriver, a journey from the Java side
Node.js and Selenium Webdriver, a journey from the Java sideMek Srunyu Stittri
 
Automation testing strategy, approach & planning
Automation testing  strategy, approach & planningAutomation testing  strategy, approach & planning
Automation testing strategy, approach & planningSivaprasanthRentala1975
 
Selenium Best Practices with Jason Huggins
Selenium Best Practices with Jason HugginsSelenium Best Practices with Jason Huggins
Selenium Best Practices with Jason HugginsSauce Labs
 

Viewers also liked (20)

TDD in functional testing with WebDriver
TDD in functional testing with WebDriverTDD in functional testing with WebDriver
TDD in functional testing with WebDriver
 
10 things about BDD, Cucumber and SpecFlow - Long Version 2016
10 things about BDD, Cucumber and SpecFlow - Long Version 201610 things about BDD, Cucumber and SpecFlow - Long Version 2016
10 things about BDD, Cucumber and SpecFlow - Long Version 2016
 
A journey beyond the page object pattern
A journey beyond the page object patternA journey beyond the page object pattern
A journey beyond the page object pattern
 
Do you know what you are testing?
Do you know what you are testing?Do you know what you are testing?
Do you know what you are testing?
 
Development without Testers: Myth or Real Option?
Development without Testers: Myth or Real Option?Development without Testers: Myth or Real Option?
Development without Testers: Myth or Real Option?
 
How to Use Selenium, Successfully
How to Use Selenium, SuccessfullyHow to Use Selenium, Successfully
How to Use Selenium, Successfully
 
Бытовая классификация тестировщиков с точки зрения разработчика
Бытовая классификация тестировщиков с точки зрения разработчикаБытовая классификация тестировщиков с точки зрения разработчика
Бытовая классификация тестировщиков с точки зрения разработчика
 
Webium: Page Objects In Python (Eng)
Webium: Page Objects In Python (Eng)Webium: Page Objects In Python (Eng)
Webium: Page Objects In Python (Eng)
 
How to Design a Successful Test Automation Strategy
How to Design a Successful Test Automation Strategy How to Design a Successful Test Automation Strategy
How to Design a Successful Test Automation Strategy
 
Automated Testing vs Manual Testing
Automated Testing vs Manual TestingAutomated Testing vs Manual Testing
Automated Testing vs Manual Testing
 
Test Automation Framework Design | www.idexcel.com
Test Automation Framework Design | www.idexcel.comTest Automation Framework Design | www.idexcel.com
Test Automation Framework Design | www.idexcel.com
 
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
 
BDD Anti-patterns
BDD Anti-patternsBDD Anti-patterns
BDD Anti-patterns
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven Development
 
Introduction to Test Automation - Technology and Tools
Introduction to Test Automation - Technology and ToolsIntroduction to Test Automation - Technology and Tools
Introduction to Test Automation - Technology and Tools
 
Introduction to Test Automation
Introduction to Test AutomationIntroduction to Test Automation
Introduction to Test Automation
 
Node.js and Selenium Webdriver, a journey from the Java side
Node.js and Selenium Webdriver, a journey from the Java sideNode.js and Selenium Webdriver, a journey from the Java side
Node.js and Selenium Webdriver, a journey from the Java side
 
Automation Testing by Selenium Web Driver
Automation Testing by Selenium Web DriverAutomation Testing by Selenium Web Driver
Automation Testing by Selenium Web Driver
 
Automation testing strategy, approach & planning
Automation testing  strategy, approach & planningAutomation testing  strategy, approach & planning
Automation testing strategy, approach & planning
 
Selenium Best Practices with Jason Huggins
Selenium Best Practices with Jason HugginsSelenium Best Practices with Jason Huggins
Selenium Best Practices with Jason Huggins
 

Similar to DSL, Page Object and WebDriver – the path to reliable functional tests.pptx

Test Automation Framework Development Introduction
Test Automation Framework Development IntroductionTest Automation Framework Development Introduction
Test Automation Framework Development IntroductionGanuka Yashantha
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullySpringPeople
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven DevelopmentMonocularVision
 
Better End-to-End Testing with Page Objects Model using Protractor
Better End-to-End Testing with Page Objects Model using ProtractorBetter End-to-End Testing with Page Objects Model using Protractor
Better End-to-End Testing with Page Objects Model using ProtractorKasun Kodagoda
 
Automation, Selenium Webdriver and Page Objects
Automation, Selenium Webdriver and Page ObjectsAutomation, Selenium Webdriver and Page Objects
Automation, Selenium Webdriver and Page ObjectsAndrew Boyer
 
Software Testing Tools Training
Software Testing Tools TrainingSoftware Testing Tools Training
Software Testing Tools TrainingQEdge Tech
 
Agile Testing at eBay
Agile Testing at eBayAgile Testing at eBay
Agile Testing at eBayDominik Dary
 
How to use selenium successfully
How to use selenium successfullyHow to use selenium successfully
How to use selenium successfullyTEST Huddle
 
Implementing Test Automation in Agile Projects
Implementing Test Automation in Agile ProjectsImplementing Test Automation in Agile Projects
Implementing Test Automation in Agile ProjectsMichael Palotas
 
Implementing Test Automation in Agile Projects
Implementing Test Automation in Agile ProjectsImplementing Test Automation in Agile Projects
Implementing Test Automation in Agile ProjectsDominik Dary
 
Acceptance Testing of Web UI
Acceptance Testing of Web UIAcceptance Testing of Web UI
Acceptance Testing of Web UIVladimir Tsukur
 
Web Test Automation Framework - IndicThreads Conference
Web Test Automation Framework  - IndicThreads ConferenceWeb Test Automation Framework  - IndicThreads Conference
Web Test Automation Framework - IndicThreads ConferenceIndicThreads
 
BDD and Test Automation in Evalutionary Product Suite
BDD and Test Automation in Evalutionary Product SuiteBDD and Test Automation in Evalutionary Product Suite
BDD and Test Automation in Evalutionary Product SuiteLasantha Ranaweera
 
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!Puneet Kala
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with seleniumTzirla Rozental
 
Manageable Robust Automated Ui Test
Manageable Robust Automated Ui TestManageable Robust Automated Ui Test
Manageable Robust Automated Ui TestJohn.Jian.Fang
 

Similar to DSL, Page Object and WebDriver – the path to reliable functional tests.pptx (20)

Test Automation Framework Development Introduction
Test Automation Framework Development IntroductionTest Automation Framework Development Introduction
Test Automation Framework Development Introduction
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium Successfully
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven Development
 
Better End-to-End Testing with Page Objects Model using Protractor
Better End-to-End Testing with Page Objects Model using ProtractorBetter End-to-End Testing with Page Objects Model using Protractor
Better End-to-End Testing with Page Objects Model using Protractor
 
Automation, Selenium Webdriver and Page Objects
Automation, Selenium Webdriver and Page ObjectsAutomation, Selenium Webdriver and Page Objects
Automation, Selenium Webdriver and Page Objects
 
Software Testing Tools Training
Software Testing Tools TrainingSoftware Testing Tools Training
Software Testing Tools Training
 
Agile Testing at eBay
Agile Testing at eBayAgile Testing at eBay
Agile Testing at eBay
 
How to use selenium successfully
How to use selenium successfullyHow to use selenium successfully
How to use selenium successfully
 
Implementing Test Automation in Agile Projects
Implementing Test Automation in Agile ProjectsImplementing Test Automation in Agile Projects
Implementing Test Automation in Agile Projects
 
Implementing Test Automation in Agile Projects
Implementing Test Automation in Agile ProjectsImplementing Test Automation in Agile Projects
Implementing Test Automation in Agile Projects
 
Acceptance Testing of Web UI
Acceptance Testing of Web UIAcceptance Testing of Web UI
Acceptance Testing of Web UI
 
Web Test Automation Framework - IndicThreads Conference
Web Test Automation Framework  - IndicThreads ConferenceWeb Test Automation Framework  - IndicThreads Conference
Web Test Automation Framework - IndicThreads Conference
 
Automation strategies for agile testing Gaurav bansal
Automation strategies for agile testing  Gaurav bansalAutomation strategies for agile testing  Gaurav bansal
Automation strategies for agile testing Gaurav bansal
 
BDD and Test Automation in Evalutionary Product Suite
BDD and Test Automation in Evalutionary Product SuiteBDD and Test Automation in Evalutionary Product Suite
BDD and Test Automation in Evalutionary Product Suite
 
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
 
Drupal 7 ci and testing
Drupal 7 ci and testingDrupal 7 ci and testing
Drupal 7 ci and testing
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with selenium
 
Manageable Robust Automated Ui Test
Manageable Robust Automated Ui TestManageable Robust Automated Ui Test
Manageable Robust Automated Ui Test
 
Selenium web driver
Selenium web driverSelenium web driver
Selenium web driver
 
Selenium
SeleniumSelenium
Selenium
 

More from Mikalai Alimenkou

Rise and fall of Story Points. Capacity based planning from the trenches.
Rise and fall of Story Points. Capacity based planning from the trenches.Rise and fall of Story Points. Capacity based planning from the trenches.
Rise and fall of Story Points. Capacity based planning from the trenches.Mikalai Alimenkou
 
Static analysis tools as the best friend of QA
Static analysis tools as the best friend of QAStatic analysis tools as the best friend of QA
Static analysis tools as the best friend of QAMikalai Alimenkou
 
Modern CI/CD in the microservices world with Kubernetes
Modern CI/CD in the microservices world with KubernetesModern CI/CD in the microservices world with Kubernetes
Modern CI/CD in the microservices world with KubernetesMikalai Alimenkou
 
Saga about distributed business transactions in microservices world
Saga about distributed business transactions in microservices worldSaga about distributed business transactions in microservices world
Saga about distributed business transactions in microservices worldMikalai Alimenkou
 
Effectiveness tips from Kubernetes trenches by Captain Obvious
Effectiveness tips from Kubernetes trenches by Captain ObviousEffectiveness tips from Kubernetes trenches by Captain Obvious
Effectiveness tips from Kubernetes trenches by Captain ObviousMikalai Alimenkou
 
Ride the database in JUnit tests with Database Rider
Ride the database in JUnit tests with Database RiderRide the database in JUnit tests with Database Rider
Ride the database in JUnit tests with Database RiderMikalai Alimenkou
 
Wastful waste or why everything is so slow in development
Wastful waste or why everything is so slow in developmentWastful waste or why everything is so slow in development
Wastful waste or why everything is so slow in developmentMikalai Alimenkou
 
Hexagonal architecture with Spring Boot
Hexagonal architecture with Spring BootHexagonal architecture with Spring Boot
Hexagonal architecture with Spring BootMikalai Alimenkou
 
Wastful waste or why everything is so slow in development
Wastful waste or why everything is so slow in developmentWastful waste or why everything is so slow in development
Wastful waste or why everything is so slow in developmentMikalai Alimenkou
 
DevOps checklist or how to understand where is your team in DevOps landscape ...
DevOps checklist or how to understand where is your team in DevOps landscape ...DevOps checklist or how to understand where is your team in DevOps landscape ...
DevOps checklist or how to understand where is your team in DevOps landscape ...Mikalai Alimenkou
 
DevOps checklist or how to understand where is your team in DevOps landscape
DevOps checklist or how to understand where is your team in DevOps landscapeDevOps checklist or how to understand where is your team in DevOps landscape
DevOps checklist or how to understand where is your team in DevOps landscapeMikalai Alimenkou
 
Практические трудности в разработке Медкарты для целой страны
Практические трудности в разработке Медкарты для целой страныПрактические трудности в разработке Медкарты для целой страны
Практические трудности в разработке Медкарты для целой страныMikalai Alimenkou
 
Hexagonal architecture with Spring Boot [EPAM Java online conference]
Hexagonal architecture with Spring Boot [EPAM Java online conference]Hexagonal architecture with Spring Boot [EPAM Java online conference]
Hexagonal architecture with Spring Boot [EPAM Java online conference]Mikalai Alimenkou
 
Bro, manage test data like a pro! [QA Fest 2018]
Bro, manage test data like a pro! [QA Fest 2018]Bro, manage test data like a pro! [QA Fest 2018]
Bro, manage test data like a pro! [QA Fest 2018]Mikalai Alimenkou
 
Agile antipatterns: review after 10 years of practice
Agile antipatterns: review after 10 years of practiceAgile antipatterns: review after 10 years of practice
Agile antipatterns: review after 10 years of practiceMikalai Alimenkou
 
Hexagonal architecture with Spring Boot
Hexagonal architecture with Spring BootHexagonal architecture with Spring Boot
Hexagonal architecture with Spring BootMikalai Alimenkou
 
Bro, manage test data like a pro!
Bro, manage test data like a pro!Bro, manage test data like a pro!
Bro, manage test data like a pro!Mikalai Alimenkou
 
Бытовая классификация тестировщиков с точки зрения разработчика
Бытовая классификация тестировщиков с точки зрения разработчикаБытовая классификация тестировщиков с точки зрения разработчика
Бытовая классификация тестировщиков с точки зрения разработчикаMikalai Alimenkou
 
Code Review tool for personal effectiveness and waste analysis
Code Review tool for personal effectiveness and waste analysisCode Review tool for personal effectiveness and waste analysis
Code Review tool for personal effectiveness and waste analysisMikalai Alimenkou
 
Funny stories and anti-patterns from DevOps landscape
Funny stories and anti-patterns from DevOps landscapeFunny stories and anti-patterns from DevOps landscape
Funny stories and anti-patterns from DevOps landscapeMikalai Alimenkou
 

More from Mikalai Alimenkou (20)

Rise and fall of Story Points. Capacity based planning from the trenches.
Rise and fall of Story Points. Capacity based planning from the trenches.Rise and fall of Story Points. Capacity based planning from the trenches.
Rise and fall of Story Points. Capacity based planning from the trenches.
 
Static analysis tools as the best friend of QA
Static analysis tools as the best friend of QAStatic analysis tools as the best friend of QA
Static analysis tools as the best friend of QA
 
Modern CI/CD in the microservices world with Kubernetes
Modern CI/CD in the microservices world with KubernetesModern CI/CD in the microservices world with Kubernetes
Modern CI/CD in the microservices world with Kubernetes
 
Saga about distributed business transactions in microservices world
Saga about distributed business transactions in microservices worldSaga about distributed business transactions in microservices world
Saga about distributed business transactions in microservices world
 
Effectiveness tips from Kubernetes trenches by Captain Obvious
Effectiveness tips from Kubernetes trenches by Captain ObviousEffectiveness tips from Kubernetes trenches by Captain Obvious
Effectiveness tips from Kubernetes trenches by Captain Obvious
 
Ride the database in JUnit tests with Database Rider
Ride the database in JUnit tests with Database RiderRide the database in JUnit tests with Database Rider
Ride the database in JUnit tests with Database Rider
 
Wastful waste or why everything is so slow in development
Wastful waste or why everything is so slow in developmentWastful waste or why everything is so slow in development
Wastful waste or why everything is so slow in development
 
Hexagonal architecture with Spring Boot
Hexagonal architecture with Spring BootHexagonal architecture with Spring Boot
Hexagonal architecture with Spring Boot
 
Wastful waste or why everything is so slow in development
Wastful waste or why everything is so slow in developmentWastful waste or why everything is so slow in development
Wastful waste or why everything is so slow in development
 
DevOps checklist or how to understand where is your team in DevOps landscape ...
DevOps checklist or how to understand where is your team in DevOps landscape ...DevOps checklist or how to understand where is your team in DevOps landscape ...
DevOps checklist or how to understand where is your team in DevOps landscape ...
 
DevOps checklist or how to understand where is your team in DevOps landscape
DevOps checklist or how to understand where is your team in DevOps landscapeDevOps checklist or how to understand where is your team in DevOps landscape
DevOps checklist or how to understand where is your team in DevOps landscape
 
Практические трудности в разработке Медкарты для целой страны
Практические трудности в разработке Медкарты для целой страныПрактические трудности в разработке Медкарты для целой страны
Практические трудности в разработке Медкарты для целой страны
 
Hexagonal architecture with Spring Boot [EPAM Java online conference]
Hexagonal architecture with Spring Boot [EPAM Java online conference]Hexagonal architecture with Spring Boot [EPAM Java online conference]
Hexagonal architecture with Spring Boot [EPAM Java online conference]
 
Bro, manage test data like a pro! [QA Fest 2018]
Bro, manage test data like a pro! [QA Fest 2018]Bro, manage test data like a pro! [QA Fest 2018]
Bro, manage test data like a pro! [QA Fest 2018]
 
Agile antipatterns: review after 10 years of practice
Agile antipatterns: review after 10 years of practiceAgile antipatterns: review after 10 years of practice
Agile antipatterns: review after 10 years of practice
 
Hexagonal architecture with Spring Boot
Hexagonal architecture with Spring BootHexagonal architecture with Spring Boot
Hexagonal architecture with Spring Boot
 
Bro, manage test data like a pro!
Bro, manage test data like a pro!Bro, manage test data like a pro!
Bro, manage test data like a pro!
 
Бытовая классификация тестировщиков с точки зрения разработчика
Бытовая классификация тестировщиков с точки зрения разработчикаБытовая классификация тестировщиков с точки зрения разработчика
Бытовая классификация тестировщиков с точки зрения разработчика
 
Code Review tool for personal effectiveness and waste analysis
Code Review tool for personal effectiveness and waste analysisCode Review tool for personal effectiveness and waste analysis
Code Review tool for personal effectiveness and waste analysis
 
Funny stories and anti-patterns from DevOps landscape
Funny stories and anti-patterns from DevOps landscapeFunny stories and anti-patterns from DevOps landscape
Funny stories and anti-patterns from DevOps landscape
 

Recently uploaded

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
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
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
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
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
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
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
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
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
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
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
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
 
"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
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 

Recently uploaded (20)

DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
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?
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
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
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
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
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
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
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
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
 
"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...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 

DSL, Page Object and WebDriver – the path to reliable functional tests.pptx

  • 1. DSL, Page Object and WebDriver – the path to reliable functional tests Mikalai Alimenkou http://xpinjection.com 06.10.2011
  • 2. 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 • Agile coach (TDD, Testing, Planning, etc.) at XP Injection (http://xpinjection.com) • Organizer of Selenium Camp, JEEConf and XP Days Ukraine conferences
  • 3. Agenda • WebDriver tests issues • Step 1: DSL introduction • Step 2: Page Object pattern • Step 3: Page Element pattern • Results analysis
  • 4. When you have a hammer, everything looks like a nail WEBDRIVER TESTS ISSUES
  • 5. Test Components Application Test Driver Data Test Logic
  • 6. How WebDriver Works? Get Driver Invoke Commands Provide Data Use Locators
  • 7. Selenium Tests Issues: Verbose By.xpath(“//input*@value=‘continue’+”) driver.findElement(By.xpath(…)).sendKeys(…); driver.findElement(By.name(…)).click(); By.css(“#results dip p.first”) By.id(“greenButton”) driver.findElements(…).size(); new WebDriverWait(driver, 30).until(…);
  • 8. Selenium Tests Issues: Not Expressive
  • 10. Selenium Tests Issues: Fragile driver.findElement(By.xpath("//input[@id=(//label[tex t()='Fax']/@for)]")).click(); What is going on here? driver.findElement(By.xpath("//div[@id='App']/div/p[4]/di v[1]/h4[@class='Online']")).getText() Depends too much on page structure!
  • 11. Even More Hidden Issues Test code duplication Hard to understand No reuse Fewer tests Hard to created support Hard to Test wrong create new things Performance problems
  • 12. What is the Primary Goal? 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
  • 13. Ideal Testing Framework Test Logic Test Data Storage DSL Application Driver Technical Driver Technical Data Storage Application Under Testing
  • 14. Create domain-specific language for your application STEP 1: INTRODUCE DSL
  • 15. Definition of DSL A domain-specific language (DSL) is a programming language or specification language dedicated to a particular problem domain, that is created specifically to solve problems in this particular domain and is not intended to be able to solve problems outside it (although that may be technically possible).
  • 17. DEMO
  • 18. Benefits of DSL Approach • High-level – tests are in the language of product management, at the user level • Readable – product management can understand them • Writable – easy for developer or QA to write new test • Extensible – tests base is able to grow with DSL
  • 19. Tips and Tricks • Use test class hierarchy or test helpers • Use builders, visitors and other design patterns • Reuse domain model from application • Some common methods move to base test class • Minimize usage of driver instance in tests
  • 20. Create page map for your application STEP 2: INTRODUCE PAGE OBJECT
  • 21. Page Object Pattern search order Index Page Search Page login search filter Main Page open see more Details close Page show me like this
  • 22. Test Architecture with Page Object
  • 23. Components Architecture Isolated Concepts logic separation Easier support Simplicity
  • 24. Ways to Implement Page Object Duplicate Site Map with Packages and Classes Move Site Structure to UI-Element
  • 26. DEMO
  • 27. “Ideal” Page Object in WebDriver
  • 28. Tips and Tricks • Allow chain invocations • Basic page with driver details and common methods • Use already included Page Object classes to simplify pages creation • Expose only what is allowed to see or do on the page • Don’t use driver instance in tests at all • Use static analysis to check rules • Use site map to prepare Page Objects
  • 29. Divide pages on reusable elements STEP 3: PAGE ELEMENTS
  • 30. Page Consists of Elements Menu Checkbox Panel Link List of Items
  • 31. Different Page Elements Checkbox TextBox Button • click • type • click • isChecked • hasValue • doubleClick • check • focus • clickAndWait • uncheck • clearText • … • … • typeAndReturn • isEditable • … Table Items Menu Panel Form
  • 32. Why Page Element Pattern? Highest Clear page level of structure code reuse Building Reliable pages from tests components
  • 33. Inversion of Control Hides the details of browser communication After Before Expose methods for what test can see and do
  • 34. DEMO
  • 36. Tellurium Basics: UI Module Groovy File Can Build XPath in Runtime All Elements Element UID Isolated Locators Available Actions
  • 37. Tellurium Basics: UI Object • uid – unique in UI module • namespace – for future extension • locator – locator of the UI object – A base locator (relative XPath) – A composite locator (object attributes) • group – applied to some kinds of UI objects to switch on grouping locating • respond – define JavaScript events the UI object could respond to • some basic methods – isElementPresent, isVisible, isDisabled, waitForElementPresent, getText, mouseOver, mouseOut, getAttribute
  • 39. DEMO
  • 40. Tips and Tricks • Create elements when first need them • Review and improve elements continuously • Isolate and hide hacks inside elements • Use open source libraries as basis • Use annotations and other metadata techniques to simplify creation
  • 41. What we have at the end of long way? RESULTS ANALYSIS
  • 42. Long Path Bring Us to… • Reliable tests • Reusable test code • Separation of concepts • Expressive tested UI structure • Short and clear tests • Tests look more like acceptance tests • Tests are understood by non-technical people
  • 43. Company DSL Library Components may be reused between different applications and projects inside a company Company AJAX Portal Components Online Store Basic Components Customer Service JSF Components
  • 44. @xpinjection http://xpinjection.com mikalai.alimenkou@xpinjection.com