Book Image

Selenium Design Patterns and Best Practices

By : Dima Kovalenko
Book Image

Selenium Design Patterns and Best Practices

By: Dima Kovalenko

Overview of this book

Table of Contents (18 chapters)
Selenium Design Patterns and Best Practices
Credits
Foreword
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Foreword

"But wouldn't we be much more efficient if we could just record our tests and play them back?" Chris, the QA manager, stood at my desk looking for confirmation.

I recall my mouth actually hanging open for a moment, then stammering something like, "What the…I don't even…Wait, what?"

I was working for a small company that produced off-the-shelf software for small- to medium-sized businesses. As part of the product line, it had a client-server desktop application, which also featured a web portal. I had spent the previous couple of years working with a small team of colleagues to create a successful automated testing framework for the desktop application. We built it from the ground up and automated a significant portion of the testing of the desktop application with it. We had intentionally left the testing of the web portal to be done manually, with the intention to automate it later. The company had also recently purchased another company that provided a web-only product intended for use by larger enterprise customers. With the purchase of the other company, automating the tests for the web products was becoming more important.

Additionally, we'd already gone through the process of tool evaluation for the automated testing of the web products. We knew that as a small company, we didn't have a huge budget to purchase expensive commercial testing tools. In fact, the budget was nonexistent; we'd have to make do with tools that were free or nearly so, and wire them together ourselves. Given that both web products supported multiple browsers, we had landed on Selenium as our solution, specifically choosing the newer WebDriver API over the older remote control API.

Mistakenly taking my apparent confusion for his having interrupted me from a tricky bit of coding, Chris pressed on to explain, "I mean, you've done great on the desktop application, but as you said, you need to be a programmer to effectively use those tests. That's great for you and Barbara because you've been working on the framework and understand how to code. The new guy, Derek, has some skills there too, and he's been able to use it pretty well. However, that kind of leaves out Cindy, Josh, and Brian. Wouldn't it be great if we could just use the Selenium IDE to record those test for the websites? Then, they could get automated tests into the suite too. We could even get Christian, the business analyst, in on it too!" Just like that, we'd started down a path; one that you may have started down yourself.

Dima Kovalenko's approach discusses problems that nearly every Selenium user has encountered at one time or another. His knowledge of the subject is born from years of experience, and that hard-won knowledge is now available to you in this very volume. By applying the patterns found here, you can navigate your way to efficient solutions to those problems. Additionally, Dima's writing style uses consistent examples throughout, and the language is engaging and easy to follow.

I envy you, dear reader. Douglas Adams, author of The Hitchhiker's Guide to the Galaxy, once wrote, "Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so." If we had a book like this in the situation I described earlier, our Selenium implementation would have been much smoother. Whether you're reading this because you are looking to acquire more knowledge about Selenium on your own, or whether you've been told to use Selenium by someone else, you now have the opportunity to benefit from the experiences of those who have gone before. Seize that opportunity and enjoy working with Selenium.

Jim Evans

Core contributor to the WebDriver project, musician, and devoted husband and father