From the course: Advanced Selenium: Page Objects and GUI Automation

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Trade-offs and decisions

Trade-offs and decisions

From the course: Advanced Selenium: Page Objects and GUI Automation

Start my 1-month free trial

Trade-offs and decisions

- [Instructor] There is no one right way to model an application. We need to view the creation of abstractions as an incremental process of making decisions. So let's have a look at some of the decisions we have to make and how they've been illustrated by the concepts we've covered. So inheritance versus composition is a big decision. I generally default to composition, which is what you've seen throughout the course. Simply because I find loose coupling easier to maintain long-term. But inheritance might be a useful decision, so let's have a look at a base test approach. A common inheritance mechanism people use is the base test, Which makes sense when all the tests are GUI tests working on the same application, why not have a base object that all the tests extend? And you can see that this test, the InheritanceExampleTest, on line 12 extends a BaseGUITest object. And here, the BaseGUITest has two common methods.…

Contents