• Define a Test Strategy
• Pick a Programming Language
• Choose a Text Editor
On Defining a Test Strategy
1. How does your business make money?
2. How do your users user your application?
3. What browsers are your users using?
4. What things have broken before?
Outcome: What to test and which browsers to care about
On Picking a Programming Language
• Same language as the app?
• Who will own it?
• Build a framework or use an existing one?
• What about a scripting language?
On Choosing a Text Editor
• Sublime Text
2. Write Tests Well
• For a test runner
• Stored in Version Control
3. Selenium Fundamentals
• Mimics human action
• Uses a few common actions
• Works with “locators”
Good locators are:
• unlikely to change
That rules a few of these out: Link Text; Partial Link Text; Tag Name
Good locators are:
Use CSS or XPath sanely
CSS vs XPath
Finding Quality Locators
• Inspect the page
• Verify your selection
• e.g., FirePath or FireFinder
• Learn through gaming
Common Selenium actions
Look up your language’s bindings http://bit.ly/seleniumwiki
A Login Example
1. Visit the main page of a site
2. Find the login button and click it
3. Find the login form’s username field and input text
4. Find the login form’s password field and input text
5. Find the submit button and click it
4. Write Re-usable/Maintainable Test Code
• Page Object Pattern
• Facade layer (a.k.a. Base Page Object)
5. Make Your Tests Resilient
• Specify an amount of time, and an action
• Selenium will try until either:
• The action can be accomplished, or
• The amount of time has been reached (and throw a timeout exception)
6. Prepping for use (for humans and robots)
• Central setup/teardown
• Folder structure
• Config file(s)
• Reporting (screenshots, JUnit XML, etc.)
• Command-line execution wrapper
A simple file/folder structure
• Test packs
• Some tagging ideas
• component name
• story number
What this looks like in RSpec http://bit.ly/rspectagging
• For robots: JUnit XML output
• For humans: screenshots, video, logs, etc.
7. Scale It
• Scaled execution (e.g., 3rd party cloud provider)
• Continuous Integration
Parallelization (can be done)
• In code
• with threads: http://bit.ly/seleniumparallel1
• with processes: http://bit.ly/seleniumparallel2
• Through a test runner (e.g., TestNG in Java)
• Through your CI server
#protip enforce random order execution of tests
• Feedback loops
• Code promotion
• The goal: Find failures early and often
• Notification types
• Email, chat, SMS
• In-person (audio & visual)
Simple Jenkins configuration
1. Create a Job
2. Pull In Your Test Code
3. Set up Build Triggers
4. Configure Build steps
5. Configure Test Reports
6. Set up Notifications
7. Run Tests & View The Results
Write business valuable tests that are reusable, maintainable and resilient.!
Then package them for humans and robots — and scale them for you & your team.