The Way of the Web Tester
A Beginners Guide to Automating Tests
by Jonathan Rasmusson
Version: P3.0 (June 2017)
Copyright 2016 The Pragmatic Programmers, LLC. This book is licensed to the individual who purchased it. We don't copy-protect it because that would limit your ability to use it for your own purposes. Please don't break this trustyou can use this across all of your devices but please do not share this copy with other members of your team, with friends, or via file sharing services. Thanks.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and The Pragmatic Programmers, LLC was aware of a trademark claim, the designations have been printed in initial capital letters or in all capitals. The Pragmatic Starter Kit, The Pragmatic Programmer, Pragmatic Programming, Pragmatic Bookshelf and the linking g device are trademarks of The Pragmatic Programmers, LLC.
The yellow adhesive note graphic in Chapter 11 is designed by Layerace from Freepik.com.
Every precaution was taken in the preparation of this book. However, the publisher assumes no responsibility for errors or omissions, or for damages that may result from the use of information (including program listings) contained herein.
About the Pragmatic Bookshelf
The Pragmatic Bookshelf is an agile publishing company. Were here because we want to improve the lives of developers. We do this by creating timely, practical titles, written by programmers for programmers.
Our Pragmatic courses, workshops, and other products can help you and your team create better software and have more fun. For more information, as well as the latest Pragmatic titles, please visit us at http://pragprog.com.
Our ebooks do not contain any Digital Restrictions Management, and have always been DRM-free. We pioneered the beta book concept, where you can purchase and read a book while its still being written, and provide feedback to the author to help make a better book for everyone. Free resources for all purchasers include source code downloads (if applicable), errata and discussion forums, all available on the book's home page at pragprog.com. Were here to make your life easier.
New Book Announcements
Want to keep up on our latest titles and announcements, and occasional special offers? Just create an account on pragprog.com (an email address and a password is all it takes) and select the checkbox to receive newsletters. You can also follow us on twitter as @pragprog.
About Ebook Formats
If you buy directly from pragprog.com, you get ebooks in all available formats for one price. You can synch your ebooks amongst all your devices (including iPhone/iPad, Android, laptops, etc.) via Dropbox. You get free updates for the life of the edition. And, of course, you can always come back and re-download your books when needed. Ebooks bought from the Amazon Kindle store are subject to Amazon's polices. Limitations in Amazon's file format may cause ebooks to display differently on different devices. For more information, please see our FAQ at pragprog.com/frequently-asked-questions/ebooks. To learn more about this book and access the free resources, go to https://pragprog.com/book/jrtest, the book's homepage.
Thanks for your continued support,
Andy Hunt
The Pragmatic Programmers
The team that produced this book includes: Susannah Davidson Pfalzer (Development Editor) Potomac Indexing, LLC (Indexing) Nicole Abramowitz (Copy Editor) Gilson Graphics (Layout) Janet Furlow (Producer)
For customer support, please contact .
For international rights, please contact .
Table of Contents
Early praise for The Way of the Web Tester
The Way of the Web Tester is really The Way of the Conscientious Web Developer, providing a comprehensive journey through automated behavior-testing for web applications, from round-trip UI tests to fast-running unit tests. The examples are never simplistic, and helpful characters, including Diane the Developer and Tim the Tester, seem to know exactly what the reader is thinking. If youre writing web applications, you should have this book in your back pocket.
Dan North |
Principal consultant, Dan North & Associates Ltd. |
Everything in this book IS awesome! What I love most about The Way of the Web Tester is that its a book for the whole team. Whether youre a tester nervous about coding skills, or a coder anxious about writing maintainable tests, this book will encourage you to collaborate for success. The step-by-step visuals will guide you through good coding and design practices and principles for robust, valuable automated tests. Most importantly, youll learn how to deliver great software by writing tests first!
Lisa Crispin |
Co-author with Janet Gregory of More Agile Testing: Learning Journeys for the Whole Team, http://www.agiletester.ca |
This is a highly inspirational book on test automation: as a reader, you get a deep understanding of what role test automation plays and the value it brings for the tech industry. Whether youre a tester, developer, or product owner, after finishing there should no longer be any doubts: quality must be built in from the start.
Julia Osk |
Engineer, Spotify |
This book has some great ideas and examples, and I willrecommend it to teams who are struggling with automation and how to start.
Janet Gregory |
Agile coach, with focus on testing, DragonFire Inc. |
Chapter 1 is probably the best overview of automated testing I have ever read.
PJ Hampton |
PhD candidate and teaching assistant, Ulster University |
Acknowledgements
This book would not have been possible were it not for the love of my life, Tannis, and our three wonderful children, Lucas, Rowan, and Brynn, who supported and loved me every step of the way.
A book like this doesnt happen without a wonderful editor and publisher. Everything quality can be attributed to Susannah Pfalzer. Everything else is mine.
And of course this book wouldnt be what it is without the incredible feedback and insight generously given by its reviewers and commenters:
Matteo Vaccari, Julia Osk, Dan North, Kristian Karl, Fredrik Stridsman, Lisa Crispin, Michael Thelin, Bianca Mihai, Anders Ivarsson, Peter Hampton, Nigel Lowry, Javier Collado, Jason Yip, Elijah Wright, Michael Holland, Nicolae Ciocan, Loren Sands-Ramshaw, ...
Its Good to See You!
This is a book about how to write automated tests for the web. Its a book for anyone who has ever wanted to learn:
- How automated testing on the web works
- What the different kinds of automated tests are
- And, most importantly, how to get started writing them, even if you have little or no programming background or experience
Be warnedthis isnt your typical deep dive tutorial book. We arent going to spend hundreds of pages walking you through how to set up this kind of test framework or that. The technology changes too quickly.
Instead, we are going to focus on the fundamentals. Those things that simply dont change. These you will be able to take with you and apply to any projectregardless of which automated test framework or platform you choose to use.