SlideShare a Scribd company logo
Duda Selenium Automation
MAIN ASPECTS
Aug 2017
Who
Am I ?
https://www.linkedin.com/in/tallanda
tal.landa@gmail.com
● About 1500 Selenium tests
● pass rate < 70%
● 3.5 hours for the entire suite
● Once a day
● Maintenance ~ 30%
● No one really cares about
automation apart from the QA team
● 2.5 automation developers
One Year Ago Now
● Over 3000 Selenium tests
● pass rate > 99%
● Less than 15 minutes for the entire suite
● 30 times a day on different code branches
● Maintenance less than 5%
● Dev is fully committed to keep
automation tests clean
● 2.5 automation developers
What Made The Difference
Architecture
Change
Short Test
Flows
Stable Tests
Only
Visualization
● Focus on very specific checkpoints:
○ Run faster
○ Easy to debug
○ The failure is clear
● Api or other shortcuts usage for peripheral functions:
○ Get to the required condition via fastest and safest way
● Avoid using complicated flows
○ Only if absolutely a must
○ Avoid test dependencies
Atomic Test Flows
● Testing the new tests:
○ All new tests shall run successfully on a sanbox 30 times in a row
○ All tests must pass
○ Runtime < 200 sec per class
● Code Review:
○ Code review meeting with automation team
● Only after sandbox and code review, new tests are added to
“production” XML
(Very) Stable Tests Only
Visualize – Jenkins Pipeline
Visualize – Automation Dashboard
● Short Test Flows
● Stable Tests Only
● Visualization/Immediate Feedback
Wrapping Up
Selenium
Done Right
WWHB Design pattern
About
me
UI Testing Weakness
Bad selectors
Scattered UI flow
Bad waits and
sleeps
Tests prioritized
Obfuscated code in
tests
Bad log report
The small things
video
Asynchronous
Browser
Opening video
● Automation tests are not scripts - they’re software.
● A software project should have a good design and architecture to
overcome future challenges.
● The software developing team should be devoted to maintain a high
quality code standard.
● “The chain is strong as its weakest link”
● It’s not enough if it works
Automation Is Software
Like a glove
● Clean code should be simple and direct
● Clean code should read like well written prose
● Clean code is when each routine you read is pretty
much what you’ve expected
● A function should do one thing, it should do it well
and it should do it only
● Clean code always looks like it was written by
someone who cares
Clean Code
Robert Cecil Martin
a.k.a Uncle bob
● Selector properties
○ Unique
○ Meaningful
○ Low chance of change
● Be the change
Selectors & API’s
WWHB Design Pattern
● What to test
● Where to find the elements
● How to execute the test
● The Browser
● What: @Test
● Best practices
○ Small atomic tests - no priority
○ Setups and teardowns in every @Test
○ Think small - every function should be well thought of.
In Assert use contains, toLowerCase…
○ Minimal logic in tests, only well written prose
○ Minimal global variables
● Measure your code
○ Test score system: url
○ Old navigation test: url
○ New navigation test: url
What
● Where: Page Objects
● In test findBy() -> elementfinder class per test -> @FindBy -> enum -
> public static class
● Best practice
○ Minimal logic in page objects - only simple actions
○ No cross page object function calls
Where
THIS IS HUGE!!
● How: Logics
● Structure of logics and inheritance
● Obstacles solved as part of the infrastructure, not ad hoc per test
(publishSite, setText, Hover, importTemplates)
How
BROWSE
R
TOUCHER
● The browser is the enemy - no one is doing
element.click()
element.getCssValue()
driver.get()
driver.findElement(by)
……
Browser
THIS IS ALSO HUGE!!!!
Test suit
● The browser is the enemy - no one is doing
element.click()
element.getCssValue()
driver.get()
driver.findElement(by)
……
Browser
BROWSE
R
TOUCHER
Test suit
Architecture
LOGICS
Tests
Page Objects
Browser
● Extra:
● Smart waits and ExpectedCondition + stopwatch
● Static functions - no side effects
● Testng-failed.xml for retry
● Sandbox with test randomizer
● FocusOnIframe - open close principle
Extra topics
● Automation is software
● Clean code
● WWHB design pattern
Conclusion
Thank You!

More Related Content

What's hot (20)

PDF
Ruin your life using robot framework
Prayoch Rujira
 
PPTX
Ui Testing with Ghost Inspector
Harvard Web Working Group
 
PDF
Gatling Performance Workshop
Sai Krishna
 
ODP
Keeping up with the changes: Automating UAT - Damian Sweeney, Student and Aca...
Blackboard APAC
 
PDF
Accomplishment report at QNAP
Jun-Wei Lin
 
PDF
Background threads, async communication and vaadin
Petter Holmström
 
PDF
Introduction to K6
Knoldus Inc.
 
PDF
Keeping business logic out of your UIs
Petter Holmström
 
PPT
JavaSkop - Automation Skopje
Ana Sarbescu
 
PPTX
Value of Unit Testing
Ferose Khan J
 
PDF
Picking the right architecture and sticking to it
Petter Holmström
 
PDF
Meetup React Sanca - 29/11/18 - React Testing
Augusto Lazaro
 
KEY
Overview of Testing Talks at Pycon
Jacqueline Kazil
 
PPTX
Mocking in python
Ooblioob
 
PDF
My Test Automation Journey
Vaidas Pilkauskas
 
ODP
Akka Persistence
Knoldus Inc.
 
PPTX
Test driving QML
Artem Marchenko
 
PDF
How to go about testing in React?
Lisa Gagarina
 
PDF
Improve the deployment process step by step
Daniel Fahlke
 
PDF
Front-end Testing (manual, automated, you name it) - Erich Jagomägis - Develo...
MobileMonday Estonia
 
Ruin your life using robot framework
Prayoch Rujira
 
Ui Testing with Ghost Inspector
Harvard Web Working Group
 
Gatling Performance Workshop
Sai Krishna
 
Keeping up with the changes: Automating UAT - Damian Sweeney, Student and Aca...
Blackboard APAC
 
Accomplishment report at QNAP
Jun-Wei Lin
 
Background threads, async communication and vaadin
Petter Holmström
 
Introduction to K6
Knoldus Inc.
 
Keeping business logic out of your UIs
Petter Holmström
 
JavaSkop - Automation Skopje
Ana Sarbescu
 
Value of Unit Testing
Ferose Khan J
 
Picking the right architecture and sticking to it
Petter Holmström
 
Meetup React Sanca - 29/11/18 - React Testing
Augusto Lazaro
 
Overview of Testing Talks at Pycon
Jacqueline Kazil
 
Mocking in python
Ooblioob
 
My Test Automation Journey
Vaidas Pilkauskas
 
Akka Persistence
Knoldus Inc.
 
Test driving QML
Artem Marchenko
 
How to go about testing in React?
Lisa Gagarina
 
Improve the deployment process step by step
Daniel Fahlke
 
Front-end Testing (manual, automated, you name it) - Erich Jagomägis - Develo...
MobileMonday Estonia
 

Similar to Selenium done right (20)

PDF
Automated testing
Aiste Stikliute
 
PDF
Wso2con test-automation
krishantha_samaraweera
 
PDF
Put "fast" back in "fast feedback"
Lars Thorup
 
PDF
WSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
WSO2
 
PDF
Introduction to Test Automation
Pekka Klärck
 
PPTX
Automation is Easy! (python version)
Iakiv Kramarenko
 
PPTX
How to establish ways of working that allows shifting-left of the automation ...
Max Barrass
 
PDF
Getting started with unit and functional testing
Adewale Andrade
 
PDF
High Performance Software Engineering Teams
Lars Thorup
 
PPTX
Unit Testing and TDD 2017
Xavi Hidalgo
 
PPTX
OutSystems Tips and Tricks
OutSystems
 
PDF
Quality Assurance: An Overview
Anant Corporation
 
PDF
Tdd in swift
Javal Nanda
 
PDF
Test-Driven Development (TDD) in Swift
Amey Tavkar
 
ODP
RandomTest - Random Software Integration Tests That Just Work for C/C++, Java...
dcieslak
 
PDF
Making cross browser tests beautiful
Meaghan Lewis
 
PDF
Release & Iterate Faster: Stop Manual Testing
Drew Hannay
 
PDF
Demise of test scripts rise of test ideas
Richard Robinson
 
PDF
Best practices for JavaScript RIAs
Carlos Ble
 
PDF
Test automation - Building effective solutions
Artem Nagornyi
 
Automated testing
Aiste Stikliute
 
Wso2con test-automation
krishantha_samaraweera
 
Put "fast" back in "fast feedback"
Lars Thorup
 
WSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
WSO2
 
Introduction to Test Automation
Pekka Klärck
 
Automation is Easy! (python version)
Iakiv Kramarenko
 
How to establish ways of working that allows shifting-left of the automation ...
Max Barrass
 
Getting started with unit and functional testing
Adewale Andrade
 
High Performance Software Engineering Teams
Lars Thorup
 
Unit Testing and TDD 2017
Xavi Hidalgo
 
OutSystems Tips and Tricks
OutSystems
 
Quality Assurance: An Overview
Anant Corporation
 
Tdd in swift
Javal Nanda
 
Test-Driven Development (TDD) in Swift
Amey Tavkar
 
RandomTest - Random Software Integration Tests That Just Work for C/C++, Java...
dcieslak
 
Making cross browser tests beautiful
Meaghan Lewis
 
Release & Iterate Faster: Stop Manual Testing
Drew Hannay
 
Demise of test scripts rise of test ideas
Richard Robinson
 
Best practices for JavaScript RIAs
Carlos Ble
 
Test automation - Building effective solutions
Artem Nagornyi
 
Ad

Recently uploaded (20)

PDF
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
PPTX
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PPTX
Comprehensive Risk Assessment Module for Smarter Risk Management
EHA Soft Solutions
 
PPTX
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PDF
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
PDF
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PDF
NEW-Viral>Wondershare Filmora 14.5.18.12900 Crack Free
sherryg1122g
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Comprehensive Risk Assessment Module for Smarter Risk Management
EHA Soft Solutions
 
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
NEW-Viral>Wondershare Filmora 14.5.18.12900 Crack Free
sherryg1122g
 
Tally software_Introduction_Presentation
AditiBansal54083
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
Ad

Selenium done right

  • 1. Duda Selenium Automation MAIN ASPECTS Aug 2017
  • 3. ● About 1500 Selenium tests ● pass rate < 70% ● 3.5 hours for the entire suite ● Once a day ● Maintenance ~ 30% ● No one really cares about automation apart from the QA team ● 2.5 automation developers One Year Ago Now ● Over 3000 Selenium tests ● pass rate > 99% ● Less than 15 minutes for the entire suite ● 30 times a day on different code branches ● Maintenance less than 5% ● Dev is fully committed to keep automation tests clean ● 2.5 automation developers
  • 4. What Made The Difference Architecture Change Short Test Flows Stable Tests Only Visualization
  • 5. ● Focus on very specific checkpoints: ○ Run faster ○ Easy to debug ○ The failure is clear ● Api or other shortcuts usage for peripheral functions: ○ Get to the required condition via fastest and safest way ● Avoid using complicated flows ○ Only if absolutely a must ○ Avoid test dependencies Atomic Test Flows
  • 6. ● Testing the new tests: ○ All new tests shall run successfully on a sanbox 30 times in a row ○ All tests must pass ○ Runtime < 200 sec per class ● Code Review: ○ Code review meeting with automation team ● Only after sandbox and code review, new tests are added to “production” XML (Very) Stable Tests Only
  • 9. ● Short Test Flows ● Stable Tests Only ● Visualization/Immediate Feedback Wrapping Up
  • 12. UI Testing Weakness Bad selectors Scattered UI flow Bad waits and sleeps Tests prioritized Obfuscated code in tests Bad log report The small things video Asynchronous Browser Opening video
  • 13. ● Automation tests are not scripts - they’re software. ● A software project should have a good design and architecture to overcome future challenges. ● The software developing team should be devoted to maintain a high quality code standard. ● “The chain is strong as its weakest link” ● It’s not enough if it works Automation Is Software
  • 15. ● Clean code should be simple and direct ● Clean code should read like well written prose ● Clean code is when each routine you read is pretty much what you’ve expected ● A function should do one thing, it should do it well and it should do it only ● Clean code always looks like it was written by someone who cares Clean Code Robert Cecil Martin a.k.a Uncle bob
  • 16. ● Selector properties ○ Unique ○ Meaningful ○ Low chance of change ● Be the change Selectors & API’s
  • 17. WWHB Design Pattern ● What to test ● Where to find the elements ● How to execute the test ● The Browser
  • 18. ● What: @Test ● Best practices ○ Small atomic tests - no priority ○ Setups and teardowns in every @Test ○ Think small - every function should be well thought of. In Assert use contains, toLowerCase… ○ Minimal logic in tests, only well written prose ○ Minimal global variables ● Measure your code ○ Test score system: url ○ Old navigation test: url ○ New navigation test: url What
  • 19. ● Where: Page Objects ● In test findBy() -> elementfinder class per test -> @FindBy -> enum - > public static class ● Best practice ○ Minimal logic in page objects - only simple actions ○ No cross page object function calls Where THIS IS HUGE!!
  • 20. ● How: Logics ● Structure of logics and inheritance ● Obstacles solved as part of the infrastructure, not ad hoc per test (publishSite, setText, Hover, importTemplates) How
  • 21. BROWSE R TOUCHER ● The browser is the enemy - no one is doing element.click() element.getCssValue() driver.get() driver.findElement(by) …… Browser THIS IS ALSO HUGE!!!! Test suit
  • 22. ● The browser is the enemy - no one is doing element.click() element.getCssValue() driver.get() driver.findElement(by) …… Browser BROWSE R TOUCHER Test suit
  • 24. ● Extra: ● Smart waits and ExpectedCondition + stopwatch ● Static functions - no side effects ● Testng-failed.xml for retry ● Sandbox with test randomizer ● FocusOnIframe - open close principle Extra topics
  • 25. ● Automation is software ● Clean code ● WWHB design pattern Conclusion