SlideShare a Scribd company logo
1 of 42
DSL, Page Object and Selenium – a way to reliable functional tests  Mikalai Alimenkou http://xpinjection.com 26.02.2011
Background Java Technical Lead/Scrum Master at Zoral Labs 6+ years in software development 4+ years of working by Agile methodologies Expert in Agile engineering practices Agile coach (TDD, Testing, Planning, etc.)at XP Injection (http://xpinjection.com)
Agenda Selenium tests issues Step 1: DSL introduction Step 2: Page Object pattern Step 3: Page Element pattern Results analysis
Selenium TESTS Issues When you have a hammer, everything looks like a nail
Test Components Application Driver Test Data Test Logic
How Selenium Works? Get Browser InvokeCommands Provide Data Use Locators
Selenium Tests Issues: Verbose xpath=//input[@value=‘continue’] browser.enter… browser.click… css=#results dip p.first browser.getXpathCount… id=greenButton browser.waitForPageToLoad… browser.check…
Selenium Tests Issues: Not Expressive
Selenium Tests Issues: Unreadable
Selenium Tests Issues: Fragile browser.click("//input[@id=(//label[text()='Fax']/@for)] "); What is going on here? browser.getText(“//div[@id='App']/div/p[4]/div[1]/h4[@class='Online']”); Depends too much on page structure!
Even More Hidden Issues
What is the Primary Goal? To enable reliable stable tests we need to separate all parts as much as possible
Ideal Testing Framework Test Data Storage Technical Data Storage
Step 1: Introduce DSL Create domain-specific language for your application
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 solveproblems 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 browser instance in tests
Step 2: Introduce Page Object Create page map for your application
Page Object Pattern Index Page order search Search Page login search filter Main Page open see more Details Page close show me like this
Test Architecture with Page Object
Components Architecture Isolated logic Concepts separation Easier support Simplicity
Ways to Implement Page Object Duplicate Site Map with Packages and  Classes Move Site Structure  to UI-Element
DEMO
Tips and Tricks Allow chain invocations Basic page with browser details and common methods Expose only what is allowed to see or do on the page Don’t use browser instance in tests at all Use static analysis to check rules Use site map to prepare Page Objects
Step 3: Page Elements Divide pages on reusable elements
Page Consists of Elements Menu Checkbox Panel Link List of Items
Different Page Elements
Why Page Element Pattern?
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
Results ANALYSIS What we have at the end of long way?
Long Way 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 AJAX Components Company Portal Basic Components Online Store JSF Components Customer Service
Any Questions?

More Related Content

What's hot (20)

Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JS
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 
Ajax presentation
Ajax presentationAjax presentation
Ajax presentation
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
 
Asynchronous JavaScript & XML (AJAX)
Asynchronous JavaScript & XML (AJAX)Asynchronous JavaScript & XML (AJAX)
Asynchronous JavaScript & XML (AJAX)
 
Page object pattern
Page object patternPage object pattern
Page object pattern
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
 
Ajax and Jquery
Ajax and JqueryAjax and Jquery
Ajax and Jquery
 
Design patterns in test automation
Design patterns in test automationDesign patterns in test automation
Design patterns in test automation
 
Asynchronous javascript
 Asynchronous javascript Asynchronous javascript
Asynchronous javascript
 
Test Complete
Test CompleteTest Complete
Test Complete
 
Testing of React JS app
Testing of React JS appTesting of React JS app
Testing of React JS app
 
Selenium WebDriver
Selenium WebDriverSelenium WebDriver
Selenium WebDriver
 
Web automation using selenium.ppt
Web automation using selenium.pptWeb automation using selenium.ppt
Web automation using selenium.ppt
 
PHP - Introduction to PHP AJAX
PHP -  Introduction to PHP AJAXPHP -  Introduction to PHP AJAX
PHP - Introduction to PHP AJAX
 
JUnit 4
JUnit 4JUnit 4
JUnit 4
 
Express JS
Express JSExpress JS
Express JS
 
Responsive web-design through bootstrap
Responsive web-design through bootstrapResponsive web-design through bootstrap
Responsive web-design through bootstrap
 

Viewers also liked

DSL, Page Object and WebDriver – the path to reliable functional tests.pptx
DSL, Page Object and WebDriver – the path to reliable functional tests.pptxDSL, Page Object and WebDriver – the path to reliable functional tests.pptx
DSL, Page Object and WebDriver – the path to reliable functional tests.pptxMikalai Alimenkou
 
DSL in test automation
DSL in test automationDSL in test automation
DSL in test automationtest test
 
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
 
Selenium - The page object pattern
Selenium - The page object patternSelenium - The page object pattern
Selenium - The page object patternMichael Palotas
 
Using The Page Object Pattern
Using The Page Object PatternUsing The Page Object Pattern
Using The Page Object PatternDante Briones
 
How QA engineers could affect quality?
How QA engineers could affect quality?How QA engineers could affect quality?
How QA engineers could affect quality?Mikalai Alimenkou
 
Бытовая классификация тестировщиков с точки зрения разработчика
Бытовая классификация тестировщиков с точки зрения разработчикаБытовая классификация тестировщиков с точки зрения разработчика
Бытовая классификация тестировщиков с точки зрения разработчикаMikalai Alimenkou
 
Test Automation Framework Designs
Test Automation Framework DesignsTest Automation Framework Designs
Test Automation Framework DesignsSauce Labs
 
Compose all the things (Wicked Good Ember 2015)
Compose all the things (Wicked Good Ember 2015)Compose all the things (Wicked Good Ember 2015)
Compose all the things (Wicked Good Ember 2015)Mike North
 
Руководство по приготовлению бутербродов из Selenium
Руководство по приготовлению бутербродов из SeleniumРуководство по приготовлению бутербродов из Selenium
Руководство по приготовлению бутербродов из SeleniumUladzimir Kryvenka
 
DSL, Page Object и WebDriver – путь к надежным функциональным тестам
DSL, Page Object и WebDriver – путь к надежным функциональным тестамDSL, Page Object и WebDriver – путь к надежным функциональным тестам
DSL, Page Object и WebDriver – путь к надежным функциональным тестамSQALab
 
Advanced Selenium Workshop
Advanced Selenium WorkshopAdvanced Selenium Workshop
Advanced Selenium WorkshopClever Moe
 
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
 
Getting Started with Selenium
Getting Started with SeleniumGetting Started with Selenium
Getting Started with SeleniumDave Haeffner
 
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
 
Continuous Integration, the minimum viable product
Continuous Integration, the minimum viable productContinuous Integration, the minimum viable product
Continuous Integration, the minimum viable productJulian Simpson
 
Automation Abstraction Layers: Page Objects and Beyond
Automation Abstraction Layers: Page Objects and BeyondAutomation Abstraction Layers: Page Objects and Beyond
Automation Abstraction Layers: Page Objects and BeyondAlan Richardson
 
Web testing with Selenium
Web testing with SeleniumWeb testing with Selenium
Web testing with SeleniumXBOSoft
 

Viewers also liked (20)

DSL, Page Object and WebDriver – the path to reliable functional tests.pptx
DSL, Page Object and WebDriver – the path to reliable functional tests.pptxDSL, Page Object and WebDriver – the path to reliable functional tests.pptx
DSL, Page Object and WebDriver – the path to reliable functional tests.pptx
 
DSL in test automation
DSL in test automationDSL in test automation
DSL in test automation
 
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
 
Selenium - The page object pattern
Selenium - The page object patternSelenium - The page object pattern
Selenium - The page object pattern
 
Using The Page Object Pattern
Using The Page Object PatternUsing The Page Object Pattern
Using The Page Object Pattern
 
How QA engineers could affect quality?
How QA engineers could affect quality?How QA engineers could affect quality?
How QA engineers could affect quality?
 
Бытовая классификация тестировщиков с точки зрения разработчика
Бытовая классификация тестировщиков с точки зрения разработчикаБытовая классификация тестировщиков с точки зрения разработчика
Бытовая классификация тестировщиков с точки зрения разработчика
 
Automation Testing by Selenium Web Driver
Automation Testing by Selenium Web DriverAutomation Testing by Selenium Web Driver
Automation Testing by Selenium Web Driver
 
Test Automation Framework Designs
Test Automation Framework DesignsTest Automation Framework Designs
Test Automation Framework Designs
 
Compose all the things (Wicked Good Ember 2015)
Compose all the things (Wicked Good Ember 2015)Compose all the things (Wicked Good Ember 2015)
Compose all the things (Wicked Good Ember 2015)
 
Руководство по приготовлению бутербродов из Selenium
Руководство по приготовлению бутербродов из SeleniumРуководство по приготовлению бутербродов из Selenium
Руководство по приготовлению бутербродов из Selenium
 
DSL, Page Object и WebDriver – путь к надежным функциональным тестам
DSL, Page Object и WebDriver – путь к надежным функциональным тестамDSL, Page Object и WebDriver – путь к надежным функциональным тестам
DSL, Page Object и WebDriver – путь к надежным функциональным тестам
 
Advanced Selenium Workshop
Advanced Selenium WorkshopAdvanced Selenium Workshop
Advanced Selenium Workshop
 
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
 
Getting Started with Selenium
Getting Started with SeleniumGetting Started with Selenium
Getting Started with Selenium
 
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
 
Continuous Integration, the minimum viable product
Continuous Integration, the minimum viable productContinuous Integration, the minimum viable product
Continuous Integration, the minimum viable product
 
Automation Abstraction Layers: Page Objects and Beyond
Automation Abstraction Layers: Page Objects and BeyondAutomation Abstraction Layers: Page Objects and Beyond
Automation Abstraction Layers: Page Objects and Beyond
 
Serenity and the Journey Pattern
Serenity and the Journey PatternSerenity and the Journey Pattern
Serenity and the Journey Pattern
 
Web testing with Selenium
Web testing with SeleniumWeb testing with Selenium
Web testing with Selenium
 

Similar to DSL, Page Object and Selenium – a way to reliable functional tests

Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven DevelopmentMonocularVision
 
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
 
Stepin evening presented
Stepin evening presentedStepin evening presented
Stepin evening presentedVijayan Reddy
 
Test Automation Framework Development Introduction
Test Automation Framework Development IntroductionTest Automation Framework Development Introduction
Test Automation Framework Development IntroductionGanuka Yashantha
 
Manageable Robust Automated Ui Test
Manageable Robust Automated Ui TestManageable Robust Automated Ui Test
Manageable Robust Automated Ui TestJohn.Jian.Fang
 
Automated Testing Of EPiServer CMS Sites
Automated Testing Of EPiServer CMS SitesAutomated Testing Of EPiServer CMS Sites
Automated Testing Of EPiServer CMS Sitesjoelabrahamsson
 
Software Testing Tools Training
Software Testing Tools TrainingSoftware Testing Tools Training
Software Testing Tools TrainingQEdge Tech
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with seleniumTzirla Rozental
 
Test team dynamics, Антон Мужайло
Test team dynamics, Антон МужайлоTest team dynamics, Антон Мужайло
Test team dynamics, Антон МужайлоSigma Software
 
Selenium Webdriver Interview Questions
Selenium Webdriver Interview QuestionsSelenium Webdriver Interview Questions
Selenium Webdriver Interview QuestionsJai Singh
 
Selenium tutorial to Beginners
Selenium tutorial to BeginnersSelenium tutorial to Beginners
Selenium tutorial to Beginnersrajkamaltibacademy
 
Selenium interview-questions-freshers
Selenium interview-questions-freshersSelenium interview-questions-freshers
Selenium interview-questions-freshersNaga Mani
 
#2 integration + ui tests
#2 integration + ui tests#2 integration + ui tests
#2 integration + ui testseleksdev
 
Selenium ui paradigm - DDD North 2
Selenium ui paradigm - DDD North 2Selenium ui paradigm - DDD North 2
Selenium ui paradigm - DDD North 2Nathan Gloyn
 
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
 

Similar to DSL, Page Object and Selenium – a way to reliable functional tests (20)

Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven Development
 
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
 
Stepin evening presented
Stepin evening presentedStepin evening presented
Stepin evening presented
 
Test Automation Framework Development Introduction
Test Automation Framework Development IntroductionTest Automation Framework Development Introduction
Test Automation Framework Development Introduction
 
Web Testen mit Selenium
Web Testen mit SeleniumWeb Testen mit Selenium
Web Testen mit Selenium
 
Manageable Robust Automated Ui Test
Manageable Robust Automated Ui TestManageable Robust Automated Ui Test
Manageable Robust Automated Ui Test
 
Automated Testing Of EPiServer CMS Sites
Automated Testing Of EPiServer CMS SitesAutomated Testing Of EPiServer CMS Sites
Automated Testing Of EPiServer CMS Sites
 
Software Testing Tools Training
Software Testing Tools TrainingSoftware Testing Tools Training
Software Testing Tools Training
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with selenium
 
Test team dynamics, Антон Мужайло
Test team dynamics, Антон МужайлоTest team dynamics, Антон Мужайло
Test team dynamics, Антон Мужайло
 
Asif resume
Asif resumeAsif resume
Asif resume
 
Ashok_Resume
Ashok_ResumeAshok_Resume
Ashok_Resume
 
Selenium Webdriver Interview Questions
Selenium Webdriver Interview QuestionsSelenium Webdriver Interview Questions
Selenium Webdriver Interview Questions
 
Selenium tutorial to Beginners
Selenium tutorial to BeginnersSelenium tutorial to Beginners
Selenium tutorial to Beginners
 
Selenium WebDriver training
Selenium WebDriver trainingSelenium WebDriver training
Selenium WebDriver training
 
Naveenkumar.S
Naveenkumar.SNaveenkumar.S
Naveenkumar.S
 
Selenium interview-questions-freshers
Selenium interview-questions-freshersSelenium interview-questions-freshers
Selenium interview-questions-freshers
 
#2 integration + ui tests
#2 integration + ui tests#2 integration + ui tests
#2 integration + ui tests
 
Selenium ui paradigm - DDD North 2
Selenium ui paradigm - DDD North 2Selenium ui paradigm - DDD North 2
Selenium ui paradigm - DDD North 2
 
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!
 

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

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
 
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
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
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
 
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
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
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
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
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
 
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
 
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
 
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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
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
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 

Recently uploaded (20)

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?
 
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
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
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
 
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
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
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)
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
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
 
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
 
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
 
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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
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!
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 

DSL, Page Object and Selenium – a way to reliable functional tests

  • 1. DSL, Page Object and Selenium – a way to reliable functional tests Mikalai Alimenkou http://xpinjection.com 26.02.2011
  • 2. Background Java Technical Lead/Scrum Master at Zoral Labs 6+ years in software development 4+ years of working by Agile methodologies Expert in Agile engineering practices Agile coach (TDD, Testing, Planning, etc.)at XP Injection (http://xpinjection.com)
  • 3. Agenda Selenium tests issues Step 1: DSL introduction Step 2: Page Object pattern Step 3: Page Element pattern Results analysis
  • 4. Selenium TESTS Issues When you have a hammer, everything looks like a nail
  • 5. Test Components Application Driver Test Data Test Logic
  • 6. How Selenium Works? Get Browser InvokeCommands Provide Data Use Locators
  • 7. Selenium Tests Issues: Verbose xpath=//input[@value=‘continue’] browser.enter… browser.click… css=#results dip p.first browser.getXpathCount… id=greenButton browser.waitForPageToLoad… browser.check…
  • 8. Selenium Tests Issues: Not Expressive
  • 10. Selenium Tests Issues: Fragile browser.click("//input[@id=(//label[text()='Fax']/@for)] "); What is going on here? browser.getText(“//div[@id='App']/div/p[4]/div[1]/h4[@class='Online']”); Depends too much on page structure!
  • 12. What is the Primary Goal? To enable reliable stable tests we need to separate all parts as much as possible
  • 13. Ideal Testing Framework Test Data Storage Technical Data Storage
  • 14. Step 1: Introduce DSL Create domain-specific language for your application
  • 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 solveproblems 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 browser instance in tests
  • 20. Step 2: Introduce Page Object Create page map for your application
  • 21. Page Object Pattern Index Page order search Search Page login search filter Main Page open see more Details Page close show me like this
  • 22. Test Architecture with Page Object
  • 23. Components Architecture Isolated logic Concepts separation Easier support Simplicity
  • 24. Ways to Implement Page Object Duplicate Site Map with Packages and Classes Move Site Structure to UI-Element
  • 25. DEMO
  • 26. Tips and Tricks Allow chain invocations Basic page with browser details and common methods Expose only what is allowed to see or do on the page Don’t use browser instance in tests at all Use static analysis to check rules Use site map to prepare Page Objects
  • 27. Step 3: Page Elements Divide pages on reusable elements
  • 28. Page Consists of Elements Menu Checkbox Panel Link List of Items
  • 30. Why Page Element Pattern?
  • 31. Inversion of Control Hides the details of browser communication After Before Expose methods for what test can see and do
  • 32. DEMO
  • 34. Tellurium Basics: UI Module Groovy File Can Build Xpath in Runtime All Elements Element UID Isolated Locators Available Actions
  • 35. 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
  • 37. DEMO
  • 38. 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
  • 39. Results ANALYSIS What we have at the end of long way?
  • 40. Long Way 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
  • 41. Company DSL Library Components may be reused between different applications and projects inside a company AJAX Components Company Portal Basic Components Online Store JSF Components Customer Service