A comprehensive introduction to Selenium and its place in the automated testing stack. Not really *less* testing, but less *painful* testing. Also, a guide to Sauce Labs.
manual QA sucks Risk of unintended consequences grows with app complexity Cheap to run automated tests on every commit Writing automated tests is writing code Opens up possibility of Development Cycle of Optimal Happiness
points are mocked for speed/simplicity Integration / end-to-end / functional tests Tests of entire systems or integration points System is a functional black box from test’s perspective
closer they are to reality “Reality” in web environments is hard to simulate People clicking mouse buttons in browsers Different OSes, different browsers, different devices Takeaway: integration tests are more expensive
Get as much mileage as you can out of lighter-weight solutions first Debugging Selenium tests is more painful than debugging unit tests Nothing beats Selenium for uncovering cross-platform issues and legitimate stability concerns
the Selenium Server Selenium Server sends commands to browser Drivers, returns responses to script Independent Drivers for each browser/OS Bindings for speaking Selenium API to the server available in any programming language
might be before an action’s result has changed the page state, e.g. for AJAX requests Selenium will return information which results in a test failure, but wouldn’t have if it had waited longer Solution: “spin” for responses
XPath, ID, link text, tag name, input name Don’t use locators which are likely to break during refactoring of your HTML Use sensible semantics for IDs and classes
browsers that Selenium supports Infrastructure advantages No need to set up or maintain OSes, browsers, or Selenium No need to worry about scaling according to your growth Mobile is hard! Security advantages
taken throughout test Log of Selenium commands and responses Breakpoints: jump into the browser when something goes wrong Team account management REST API etc...
Great for integration testing (which should be used judiciously as a part of every build) Be aware of common pitfalls and use Selenium best practices Sauce Labs: pain-free Selenium in the cloud Coding is better and funner than manual QA!
embarrassed. We’ve all been there. There’s still time... Do it now! Start small, demand value as you build test coverage. Focus on the money path. Never let bugs prevent someone from giving you $$. Be careful: it’s addictive!