Test tool independence occurs when the test suite is not heavily integrated with any given testing tool. For example, switching from Selenium 1 to Selenium WebDriver is difficult, because both tools use different methods to locate and click on page elements. If we wrote our framework in such a way as to hide these changing methods from the test, all we need to do to upgrade to Selenium WebDriver is update the find_element
and click
methods to use the new WebDriver API. This practice is referred to as the Adapter pattern. In the previous example of this chapter, the SidebarCart
class acts as an adapter between the test and the instance of Selenium WebDriver by translating the add_to_cart
method call into a WebDriver click
method.
Selenium Design Patterns and Best Practices
By :
Selenium Design Patterns and Best Practices
By:
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
Free Chapter
Writing the First Test
The Spaghetti Pattern
Refactoring Tests
Data-driven Testing
Stabilizing the Tests
Testing the Behavior
The Page Objects Pattern
Growing the Test Suite
Getting Started with Selenium
Index
Customer Reviews