Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Knowing your automation

347 views

Published on

Slides from my talk at Selenium Conference Chicago 2018

Published in: Technology

Knowing your automation

  1. 1. Knowing your Automation Hugh McCamphill
  2. 2. Organiser Belfast Selenium Meetup Co-organiser SWTC Belfast Lead Test Engineer at ShopKeep Twitter: @hughleo01 About Me
  3. 3. @hughleo01 ● Provides a common language or model to work with ● Hides complexity / remove unimportant detail ● Get to work at a level closer to the problem being solved. Abstraction
  4. 4. @hughleo01 Test Automation Abstractions ● For example ○ Webdriver ○ Web Elements ○ Page Objects ● Useful with automation because ○ Change implementation ○ Makes automation more maintainable https://www.slideshare.net/eviltester/automation-abstraction-layers-page-objectspdf
  5. 5. @hughleo01 All non-trivial abstractions, to some degree, are leaky Joel Spolsky
  6. 6. History is a wheel, for the nature of man is fundamentally unchanging https://www.flickr.com/photos/coast_guard/7074680433/
  7. 7. @hughleo01
  8. 8. @hughleo01
  9. 9. @hughleo01 Pro: Anyone can write automation Con: Anyone can write automation
  10. 10. @hughleo01 Anyone can write automation Removed from the code - what happens when something goes wrong?
  11. 11. @hughleo01 “There’s a tool for every task and a task for every tool”
  12. 12. @hughleo01
  13. 13. @hughleo01 “I’M A SLOW LEARNER IT’S TRUE. BUT I LEARN”
  14. 14. Test Page Objects Webdriver
  15. 15. @hughleo01 “SUDDENLY YOUR JOY WILL TURN TO ASHES IN YOUR MOUTH”
  16. 16. Test Page Objects Webdriver Wrapper
  17. 17. @hughleo01
  18. 18. @hughleo01 With Capybara, entering a value in an input field can spawn five Selenium commands: ● verifying that the element is displayed ● getting its name ● determining its type ● clearing it ● then entering the text. Every call is an RPC call http://www.aosabook.org/en/selenium.html https://wiki.saucelabs.com/display/DOCS/ Tips+for+Lean%2C+Speedy+Tests+with+ Sauce+Labs
  19. 19. @hughleo01
  20. 20. @hughleo01 “THE MAN WHO PASSES THE SENTENCE SHOULD SWING THE SWORD”
  21. 21. @hughleo01 ● Finding the same element each time ● Conditional logic of element existing Every call is an RPC call
  22. 22. @hughleo01 “Knowledge is a weapon, Jon. Arm yourself well before you ride forth to battle” Composition over inheritance Domain Objects Builder Pattern Interaction Abstractions
  23. 23. @hughleo01
  24. 24. @hughleo01 Domain Object
  25. 25. @hughleo01 Builders
  26. 26. @hughleo01 Builders
  27. 27. @hughleo01 Interaction Abstractions
  28. 28. @hughleo01 Selenide example Interaction Abstractions
  29. 29. “What is dead may never die, but rises again, stronger and harder.” SGPhotography77 on Visualhunt.com / CC
  30. 30. @hughleo01 Smart Selectors Self-healing tests Codeless Maintenance freeAutomate manual testingNo Coding Required Photo credit: Rennett Stowe on Visualhunt.com / CC BY Never type a single line of code No need to learn new languages or tools We look up at the same stars, and see such different things.
  31. 31. @hughleo01 “It’s easy to confuse what is with WHAT ought to be, especially when what is has worked out in your favour”
  32. 32. @hughleo01 MY WATCH HAS ENDED
  33. 33. @hughleo01 References https://www.joelonsoftware.com/2002/11/11/the-law-of-lea ky-abstractions/ https://www.slideshare.net/alimenkou/dsl-page-object-and-s elenium-a-way-to-reliable-functional-tests https://www.slideshare.net/eviltester/automation-abstractio n-layers-page-objectspdf https://dojo.ministryoftesting.com/dojo/lessons/automation- time-to-change-our-models-iain-mccowatt?s_id=14209

×