In this recipe, we will see how to build a controller for our test automation framework. As outlined in the previous recipe, the controller will load the list of actions, and for each Action, it will import the corresponding datasheet. For each data-driven iteration, it will initialize the Action and invoke its Run
method.
Most often, a controller is implemented as a function. Here, we will implement it as a class. The reason is that, this way, we can instantiate a controller during runtime to support dynamic branching of the test flow.
Create a folder structure, as follows:
C:\Automation
C:\Automation\Data
C:\Automation\Lib
C:\Automation\Tests
C:\Automation\Config
C:\Automation\Results
C:\Automation\Solutions
Create a new test and save it as Framework_MasterDriver
under the subfolder C:\Automation\Tests
. You can also save the solution under the Solutions
subfolder. Under the Data
subfolder, create a subfolder named Framework_MasterDriver
and create...