We learnt a lot in this chapter about design patterns that we can use with Selenium WebDriver. We have learnt 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 out 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 learnt that the elements get initialized when we call
PageFactory.initElements(); in our tests or anything else that may use that code.
- LoadableComponent: In this section we had a look at the base page ...