Designing base setup classes

When the Selenium page object classes were designed, we created an abstract base class to derive all the common components and methods for each subclass in the framework. This provided a way to reduce the number of elements and code being written, and a way to share common methods among pages.

Now we are dealing with the other side of things: the test classes and data. In this case, we want to design a common setup class using the TestNG annotations for methods, which will perform common setup and teardown for all the classes in a suite. Up to now, we've seen how each test class can create its own setup and teardown methods. Another layer of setup and teardown can precede the test class ones very easily.

Here ...

Get Selenium Framework Design in Data-Driven Testing 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.