Book Image

Learning Selenium Testing Tools - Third Edition

Book Image

Learning Selenium Testing Tools - Third Edition

Overview of this book

Table of Contents (22 chapters)
Learning Selenium Testing Tools Third Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Summary


In this chapter, we learned about design patterns that we can use with Selenium WebDriver. We learned techniques that allow us to build test projects that are easy to maintain and readable by all users.

Specifically, we covered:

  • Page Objects: This is a technique where we split the test logic into separate classes. This allows us to create a Java class for each of the pages that we use on the page.

  • Page Factory: This allows us to decorate our WebElement variables in our Page objects so that we remove a lot of the look up code. We learned that the elements get initialized when we call PageFactory.initElements(); in our tests or anything else that might use this code.

  • LoadableComponent: In this section, we had a look at the base page for Page Objects that comes with the Selenium project. The LoadableComponent in a base class that allows us to remove quite a bit of code and moves the boilerplate to LoadableComponent.

Now that we've learned about design patterns, we're ready to look at...