Building a test controller

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.

Getting ready

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 ...

Get Advanced UFT 12 for Test Engineers Cookbook 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.