SlideShare a Scribd company logo
1 of 63
Pitfalls and tips withPitfalls and tips with
browser based testIngbrowser based testIng
My Background
several projects with functional testing
consulted at organizations to introduce functional testing
and builds
heavily involved in trying to improve effectiveness and
reduce maintenance
developed a framework over several projects that made use
of my learnings
Common uses of functional
tests
smoke/sanity tests for most valuable and risky features
black box/regression tests
post deployment checks and rollbacks
multi browser testing
what do we want from
tests?
correctness (when my tests work, my application is not
broken)
robustness (when my tests break, my application is broken)
what do we focus on?
what’s valuable? (it matters to us that people can do this)
what’s risky? (if this breaks, it really affects us)
so whats the problem?so whats the problem?
five problemsfive problems
1. slow tests1. slow tests
BecauseBecause
uses theuses the
entire stackentire stack
low spec hardwarelow spec hardware
tons of setuptons of setup
and teardownand teardown
talking to thetalking to the
browser is slowbrowser is slow
soso
very long feedback loopvery long feedback loop
can delay deploymentscan delay deployments
2. Brittle tests2. Brittle tests
UIUI
changeschanges
a lota lot
tests overtests over
specifyspecify
3. Random failures3. Random failures
race conditionsrace conditions
unreliable dependenciesunreliable dependencies
4. tests are hard to debug4. tests are hard to debug
too manytoo many
tests breaktests break
error messageserror messages
tell you nothingtell you nothing
5. test code becomes5. test code becomes
unmaintainableunmaintainable
insufficient commitmentinsufficient commitment
to testingto testing
inadequateinadequate
understandingunderstanding
of testingof testing
what happens
there is an initial stream of tests
tests break unnecessarily
tests become hard to maintain
team loses confidence and motivation
some teams even abandon testing via the UI
tips and trickstips and tricks
Treat test code
like real code
like real code
speed
maintainability
A lot of the techniques we useA lot of the techniques we use
with real code work with testwith real code work with test
codecode
similar levels ofsimilar levels of
commitmentcommitment
testtest
creation/maintenancecreation/maintenance
can be part of the devcan be part of the dev
cyclecycle
Use Ruby
maintainability
development time
use a headless browser
when possible
speed
Use selenium RC
(if you use selenium)
avoid brittleness
maintainability
Don’t record and replay
(if you use selenium)
avoid brittleness
maintainability
development time
Introduce an Abstraction
layer
speed
maintainability
Categorize/tag tests
speed
maintainability
Use the
page object pattern
maintainability
Parallelize
speed
separate data
for tests
speed
avoid random failures
clump data into common
location
maintainability
Push setup and teardown
out of tests
speed
avoid brittleness
development time
debuggability
Only exercise parts of the
application you want to test
speed
avoid brittleness
debuggability
Build stub services
speed
avoid random failures
don’t over specify
avoid brittleness
debuggability
run on better hardware
speed
slice vertically
debuggability
Use the right locator
maintainability
avoid brittleness
speed
learn xpath/css selectors
avoid brittleness
maintainability
fail later
speed
use polls over sleep
speed
avoid random failures
use existing waits of
selenium
speed
avoid random failures
avoid brittleness
avoid random
Don’t use assertions to
identify transitions
avoid brittleness
debuggability
avoid brittleness
screenshots and html
dumps
debuggability
xpath/css selector tester
development time
firebug or w/e
development time
maintainability
talk to me if you’retalk to me if you’re
testing tabular datatesting tabular data
I’m always available forI’m always available for
questionsquestions
Questions?Questions?
thank youthank you

More Related Content

What's hot

Test Automation Techniques for Windows Applications
Test Automation Techniques for Windows ApplicationsTest Automation Techniques for Windows Applications
Test Automation Techniques for Windows Applications
Tabăra de Testare
 
Why Automation is Required in Software Testing - OSSCamp 2014
Why Automation is Required in Software Testing - OSSCamp 2014Why Automation is Required in Software Testing - OSSCamp 2014
Why Automation is Required in Software Testing - OSSCamp 2014
OSSCube
 

What's hot (20)

[Russia] Building better product security
[Russia] Building better product security[Russia] Building better product security
[Russia] Building better product security
 
Continuous deployment
Continuous deploymentContinuous deployment
Continuous deployment
 
Automated UI Testing
Automated UI TestingAutomated UI Testing
Automated UI Testing
 
DaKiRY_BAQ2016_QADay_Marta Firlej "Microsoft Test Manager tool – how can we u...
DaKiRY_BAQ2016_QADay_Marta Firlej "Microsoft Test Manager tool – how can we u...DaKiRY_BAQ2016_QADay_Marta Firlej "Microsoft Test Manager tool – how can we u...
DaKiRY_BAQ2016_QADay_Marta Firlej "Microsoft Test Manager tool – how can we u...
 
TDD in functional testing with WebDriver
TDD in functional testing with WebDriverTDD in functional testing with WebDriver
TDD in functional testing with WebDriver
 
TGT#16 - Pain of test automatization in PAAS/SAAS solutions - Krzysztof Lembi...
TGT#16 - Pain of test automatization in PAAS/SAAS solutions - Krzysztof Lembi...TGT#16 - Pain of test automatization in PAAS/SAAS solutions - Krzysztof Lembi...
TGT#16 - Pain of test automatization in PAAS/SAAS solutions - Krzysztof Lembi...
 
OPASS - Microsoft Test Manager
OPASS - Microsoft Test ManagerOPASS - Microsoft Test Manager
OPASS - Microsoft Test Manager
 
Designing Self-maintaining UI Tests for Web Applications
Designing Self-maintaining UI Tests for Web ApplicationsDesigning Self-maintaining UI Tests for Web Applications
Designing Self-maintaining UI Tests for Web Applications
 
How to Get Started with Cypress
How to Get Started with CypressHow to Get Started with Cypress
How to Get Started with Cypress
 
17 Ways to Save Time on Manual Cross Browser Testing
17 Ways to Save Time on Manual Cross Browser Testing17 Ways to Save Time on Manual Cross Browser Testing
17 Ways to Save Time on Manual Cross Browser Testing
 
Visual Studio 2010 Testing for Developers
Visual Studio 2010 Testing for DevelopersVisual Studio 2010 Testing for Developers
Visual Studio 2010 Testing for Developers
 
MTM - Atlanta Code Camp
MTM - Atlanta Code CampMTM - Atlanta Code Camp
MTM - Atlanta Code Camp
 
Selenium ui paradigm - DDD North 2
Selenium ui paradigm - DDD North 2Selenium ui paradigm - DDD North 2
Selenium ui paradigm - DDD North 2
 
"How to deploy to production 10 times a day" Андрей Шумада
"How to deploy to production 10 times a day" Андрей Шумада"How to deploy to production 10 times a day" Андрей Шумада
"How to deploy to production 10 times a day" Андрей Шумада
 
Selenium for pythonistas
Selenium for pythonistasSelenium for pythonistas
Selenium for pythonistas
 
Testing, job or game
Testing, job or gameTesting, job or game
Testing, job or game
 
Continous Integration: A Case Study
Continous Integration: A Case StudyContinous Integration: A Case Study
Continous Integration: A Case Study
 
Test Automation Techniques for Windows Applications
Test Automation Techniques for Windows ApplicationsTest Automation Techniques for Windows Applications
Test Automation Techniques for Windows Applications
 
Why Automation is Required in Software Testing - OSSCamp 2014
Why Automation is Required in Software Testing - OSSCamp 2014Why Automation is Required in Software Testing - OSSCamp 2014
Why Automation is Required in Software Testing - OSSCamp 2014
 
When you get lost in api testing #ForumPHP
When you get lost in api testing #ForumPHPWhen you get lost in api testing #ForumPHP
When you get lost in api testing #ForumPHP
 

Similar to Browser based testing

Gozengo sauce presentation
Gozengo sauce presentationGozengo sauce presentation
Gozengo sauce presentation
Daniel Straus
 
Testing Presentation
Testing PresentationTesting Presentation
Testing Presentation
sureshpkumar
 

Similar to Browser based testing (20)

Unit Testing, TDD and the Walking Skeleton
Unit Testing, TDD and the Walking SkeletonUnit Testing, TDD and the Walking Skeleton
Unit Testing, TDD and the Walking Skeleton
 
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-54&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
 
7 Effective Practices to Follow for Selenium Automation Testing
7 Effective Practices to Follow for Selenium Automation Testing7 Effective Practices to Follow for Selenium Automation Testing
7 Effective Practices to Follow for Selenium Automation Testing
 
5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation
 
Unit testing, principles
Unit testing, principlesUnit testing, principles
Unit testing, principles
 
Implementing TDD in for .net Core applications
Implementing TDD in for .net Core applicationsImplementing TDD in for .net Core applications
Implementing TDD in for .net Core applications
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 
[DevDay 2017] Automation Testing - Speaker: Nghia Khuong - Project Manager at...
[DevDay 2017] Automation Testing - Speaker: Nghia Khuong - Project Manager at...[DevDay 2017] Automation Testing - Speaker: Nghia Khuong - Project Manager at...
[DevDay 2017] Automation Testing - Speaker: Nghia Khuong - Project Manager at...
 
[Webinar] Test First, Fail Fast - Simplifying the Tester's Transition to DevOps
[Webinar] Test First, Fail Fast - Simplifying the Tester's Transition to DevOps[Webinar] Test First, Fail Fast - Simplifying the Tester's Transition to DevOps
[Webinar] Test First, Fail Fast - Simplifying the Tester's Transition to DevOps
 
Building Maintainable Android Apps (DroidCon NYC 2014)
Building Maintainable Android Apps (DroidCon NYC 2014)Building Maintainable Android Apps (DroidCon NYC 2014)
Building Maintainable Android Apps (DroidCon NYC 2014)
 
Automated Web Testing With Selenium
Automated Web Testing With SeleniumAutomated Web Testing With Selenium
Automated Web Testing With Selenium
 
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...
 
Gozengo sauce presentation
Gozengo sauce presentationGozengo sauce presentation
Gozengo sauce presentation
 
How Gozengo Implemented a Continuous Deployment Culture from Day One
How Gozengo Implemented a Continuous Deployment Culture from Day OneHow Gozengo Implemented a Continuous Deployment Culture from Day One
How Gozengo Implemented a Continuous Deployment Culture from Day One
 
Tdd
TddTdd
Tdd
 
Software Development Standard Operating Procedure
Software Development Standard Operating Procedure Software Development Standard Operating Procedure
Software Development Standard Operating Procedure
 
Testing Presentation
Testing PresentationTesting Presentation
Testing Presentation
 
Best practice adoption (and lack there of)
Best practice adoption (and lack there of)Best practice adoption (and lack there of)
Best practice adoption (and lack there of)
 
Test Driven Development - Overview and Adoption
Test Driven Development - Overview and AdoptionTest Driven Development - Overview and Adoption
Test Driven Development - Overview and Adoption
 
Software Quality and Test Strategies for Ruby and Rails Applications
Software Quality and Test Strategies for Ruby and Rails ApplicationsSoftware Quality and Test Strategies for Ruby and Rails Applications
Software Quality and Test Strategies for Ruby and Rails Applications
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 

Browser based testing

Editor's Notes

  1. not knowing the tool not understanding what works and what doesnt
  2. there are many things you can do to speed up tests, but you have to care about it
  3. 1) yes test code is less valuable than production code 2) but production code is less valuable than the product too 3) we are only as good as our tools allow us to be 4) similar rules apply as technical debt -> grows exponentially
  4. 1) avoid a specialist 2) people are aware of testability when designing UI 3) tests are written by people who best know that section of the domain.
  5. ruby/java community does a lot around testing testing domain benefits a lot from dsls I believe ruby is a very powerful language anyway
  6. mechanize copybara
  7. 1) it generates some fairly bad code 2) you’ll get really fast anyway
  8. webrat is an example of an existing tool like this allows you to use mechanize, copybara for most tests allows you to switch to webdriver/sahi/wati which are at times faster
  9. smoke, high value, high risk, per feature
  10. highly recommended if you dont like object, read encapsulation we used cucumber, not a big fan so far
  11. don’t recommend this right away but be aware you might want to do this someday
  12. tests are parallelizable
  13. tests are parallelizable
  14. expose apis
  15. jump straight to pages assert stuff in the database or from services insert admin settings directly
  16. jump straight to pages assert stuff in the database or from services insert admin settings directly
  17. even if its valuable, dont check it on every test
  18. still use test flows per feature “it depends”
  19. fast selectors (dont worry most of the time)
  20. I prefer xpath css selectors considered more readable semantic markup is your friend
  21. on missing elemnts but may not be an assertion failures
  22. instant recognition