Running tests with the Page Objects framework

The largest advantage of the Page Object pattern is that it is not a zero-sum approach. That is, we do not need to convert the entire test suite to the Page Object framework to take advantage of it. Instead, we can slowly add new Page subclasses as they are needed and updating the existing tests to use the newly created classes as they become available. For a while, our test suite might look like a hybrid of direct Selenium click methods and the add_to_cart methods from the framework. This is perfectly acceptable as long as our code is continuously improving in the positive direction.

Note

In the following test examples, we are not using the The Action Wrapper pattern section from Chapter 5, Stabilizing ...

Get Selenium Design Patterns and Best Practices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.