Basic information on Automation Frame Work Click HERE
Automation Frame Work Flow Click Here
The following automation framework model is the result of over 18 months of planning, design, coding, and sometimes trial and error. That is not to say that it took 18 months to get it working--it was actually a working prototype at around 3 person-months. Specifically, one person working on it for 3 months!
The model focuses on implementing a keyword driven automation framework. It does not include any additional features like tracking requirements or providing traceability between automated test results and any other function of the test process. It merely provides a model for a keyword driven execution engine for automated tests.
The commercially available frameworks generally have many more features and much broader scope. Of course, they also have the price tag to reflect this.
The project was informally tasked to follow the guidelines or practices below:
- Implement a test strategy that will allow reasonably intuitive tests to be developed and executed both manually and via the automation framework.
- The test strategy will allow each test to include the step to perform, the input data to use, and the expected result all together in one line or record of the input source.
- Implement a framework that will integrate keyword driven testing and traditional scripts, allowing both to benefit from the implementation.
- Implement the framework to be completely application-independent since it will need to test at least 4 or 5 different applications once deployed.
- The framework will be fully documented and published.
- The framework will be publicly shared on the intranet for others to use and eventually (hopefully) co-develop.
1.3.2 Code and Documentation Standards
The first thing we did was to define standards for source code files and headers that would provide for in-context documentation intended for publication. This included standards for how we would use headers and what type of information would go into them.
Each source file would start with a structured block of documentation describing the purpose of the module. Each function or subroutine would likewise have a leading documentation block describing the routine, its arguments, possible return codes, and any errors it might generate. Similar standards were developed for documenting the constants, variables, dependencies, and other features of the modules.
We then developed a tool that would extract and publish the documentation in HTML format directly from the source and header files. We did this to minimize synchronization problems between the source code and the documentation, and it has worked very well.
It is beyond the scope of this work to illustrate how this is done. In order to produce a single HTML document we parse the source file and that source file’s primary headers. We format and link public declarations from the headers to the detailed documentation in the source as well as link to any external references for other documentation. We also format and group public constants, properties or variables, and user-defined types into the appropriate sections of the HTML publication.
One nice feature about this is that the HTML publishing tool is made to identify the appropriate documentation blocks and include them pretty much "as is". This enables the inclusion of HTML tags within the source documentation blocks that will be properly interpreted by a browser. Thus, for publication purposes, we can include images or other HTML elements by embedding the proper tags.
1.3.3 Our Automation Framework
Figure 4 is a diagram representing the design of our automation framework. It is followed by a description of each of the elements within the framework and how they interact. Some readers may recognize portions of this design. It is a compilation of keyword driven automation concepts from several sources. These include Linda Hayes with WorkSoft, Ed Kit from Software Development Technolgies, Hans Buwalda from CMG Corp, myself, and a few others.

Figure 4
In brief, the framework itself is really defined by the Core Data Driven Engine, the Component Functions, and the Support Libraries. While the Support Libraries provide generic routines useful even outside the context of a keyword driven framework, the core engine and Component Functions are highly dependent on the existence of all three elements.
The test execution starts with the LAUNCH TEST(1) script. This script invokes the Core Data Driven Engine by providing one or more High-Level Test Tables to CycleDriver(2). CycleDriver processes these test tables invoking the SuiteDriver(3) for each Intermediate-Level Test Table it encounters. SuiteDriver processes these intermediate-level tables invoking StepDriver(4) for each Low-Level Test Table it encounters. As StepDriver processes these low-level tables it attempts to keep the application in synch with the test. When StepDriver encounters a low-level command for a specific component, it determines what Type of component is involved and invokes the corresponding Component Function(5) module to handle the task.
All of these elements rely on the information provided in the App Map to interface or bridge the automation framework with the application being tested. Each of these elements will be described in more detail in the following sections.

1.3.4 The Application Map:
The Application Map is one of the most critical items in our framework. It is how we map our objects from names we humans can recognize to a data format useful for the automation tool. The testers for a given project will define a naming convention or specific names for each component in each window as well as a name for the window itself. We then use the Application Map to associate that name to the identification method needed by the automation tool to locate and properly manipulate the correct object in the window.
Not only does it give us the ability to provide useful names for our objects, it also enables our scripts and keyword driven tests to have a single point of maintenance on our object identification strings. Thus, if a new version of an application changes the title of our web page or the index of an image element within it, they should not affect our test tables. The changes will require only a quick modification in one place--inside the Application Map.
Figure 5 shows a simple HTML page used in one frame of a HTML frameset. Table 3 shows the object identification methods for this page for an automation tool. This illustrates how the tool’s recorded scripts might identify multiple images in the header frame or top frame of a multi-frame web page. This top frame contains the HTML document with four images used to navigate the site. Notice that these identification methods are literal strings and potentially appear many times in traditional scripts (a maintenance nightmare!):
Simple HTML Document With Four Images |
![]() |
Script referencing HTML Document Components with Literal Strings | |
OBJECT | IDENTIFICATION METHOD |
Window | "WindowTag=WebBrowser" |
Frame | "FrameID=top" |
Image | "FrameID=top;\;DocumentTitle=topFrame" |
Image | "FrameID=top;\;DocumentTitle=topFrame;\;ImageIndex=1" |
Image | "FrameID=top;\;DocumentTitle=topFrame;\;ImageIndex=2" |
Image | "FrameID=top;\;DocumentTitle=topFrame;\;ImageIndex=3" |
Image | "FrameID=top;\;DocumentTitle=topFrame;\;ImageIndex=4" |
This particular web page is simple enough. It contains only four images. However, when we look at Table 3, how do we determine which image is for Product information, and which is for Services? We should not assume they are in any particular order based upon how they are presented visually. Consequently, someone trying to decipher or maintain scripts containing these identification strings can easily get confused.
An Application Map will give these elements useful names, and provide our single point of maintenance for the identification strings as shown in Table 4. The Application Map can be implemented in text files, spreadsheet tables, or your favorite database table format. The Support Libraries just have to be able to extract and cache the information for when it is needed.
An Application Map Provides Named References for Components | |
REFERENCE | IDENTIFICATION METHOD |
Browser | "WindowTag=WebBrowser" |
TopFrame | "FrameID=top" |
TopPage | "FrameID=top;\;DocumentTitle=topFrame" |
CompInfoImage | "FrameID=top;\;DocumentTitle=topFrame;\;ImageIndex=1" |
ProductsImage | "FrameID=top;\;DocumentTitle=topFrame;\;ImageIndex=2" |
ServicesImage | "FrameID=top;\;DocumentTitle=topFrame;\;ImageIndex=3" |
SiteMapImage | "FrameID=top;\;DocumentTitle=topFrame;\;ImageIndex=4" |
Table 4
With the preceding definitions in place, the same scripts can use variables with values from the Application Map instead of those string literals. Our scripts can now reference these image elements as shown in Table 5. This reduces the chance of failure caused by changes in the application and provides a single point of maintenance in the Application Map for the identification strings used throughout our tests. It can also make our scripts easier to read and understand.
Script Using Variable References Instead of Literal Strings | |
OBJECT | IDENTIFICATION METHOD |
Window | Browser |
Frame | TopFrame |
Document | TopPage |
Image | CompInfoImage |
Image | ProductsImage |
Image | ServicesImage |
Image | SiteMapImage |
1.3.5 Component Functions:
Component Functions are those functions that actively manipulate or interrogate component objects. In our automation framework we will have a different Component Function module for each Type of component we encounter (Window, CheckBox, TextBox, Image, Link, etc..).
Our Component Function modules are the application-independent extensions we apply to the functions already provided by the automation tool. However, unlike those provided by the tool, we add the extra code to help with error detection, error correction, and synchronization. We also write these modules to readily use our application-specific data stored in the Application Map and test tables as necessary. In this way, we only have to develop these Component Functions once, and they will be used again and again by every application we test.
Another benefit from Component Functions is that they provide a layer of insulation between our application and the automation tool. Without this extra layer, changes or "enhancements" in the automation tool itself can break existing scripts and our table driven tests. With these Component Functions, however, we can insert a "fix"--the code necessary to accommodate these changes that will avert breaking our tests.
Component Function Keywords Define Our Low-Level Vocabulary:
Each of these Component Function modules will define the keywords or "action words" that are valid for the particular component type it handles. For example, the Textbox Component Function module would define and implement the actions or keywords that are valid on a Textbox. These keywords would describe actions like those in Table 6:
Some Component Function Keywords for a Textbox | |
KEYWORD | ACTION PERFORMED |
InputText | Enter new value into the Textbox |
VerifyValue | Verify the current value of the Textbox |
VerifyProperty | Verify some other attribute of the Textbox |
Each action embodied by a keyword may require more information in order to complete its function. The InputText action needs an additional argument that tells the function what text it is suppose to input. The VerifyProperty action needs two additional arguments, (1) the name of the property we want to verify, and (2) the value we expect to find. And, while we need no additional information to Click a Pushbutton, a Click action for an Image map needs to know where we want the click on the image to occur.
These Component Function keywords and their arguments define the low-level vocabulary and individual record formats we will use to develop our test tables. With this vocabulary and the Application Map object references, we can begin to build test tables that our automation framework and our human testers can understand and properly execute.
1.3.6 Test Tables:
Low-level Test Tables or Step Tables contain the detailed step-by-step instructions of our tests. Using the object names found in the Application Map, and the vocabulary defined by the Component Functions; these tables specify what document, what component, and what action to take on the component. The following three tables are examples of Step Tables comprised of instructions to be processed by the StepDriver module. The StepDriver module is the one that initially parses and routes all low-level instructions that ultimately drive our application.
Step Table: LaunchSite | ||
COMMAND/DOCUMENT | PARAMETER/ACTION | PARAMETER |
LaunchBrowser | Default.htm | |
Browser | VerifyCaption | "Login" |
Step Table: Login | |||
DOCUMENT | COMPONENT | ACTION | PARAMETER |
LoginPage | UserIDField | InputText | "MyUserID" |
LoginPage | PasswordField | InputText | "MyPassword" |
LoginPage | SubmitButton | Click |
Step Table: LogOffSite | ||
DOCUMENT | COMPONENT | ACTION |
TOCPage | LogOffButton | Click |
Table 9
Note:
In Table 7 we used a System-Level keyword, LaunchBrowser. This is also called a Driver Command. A Driver Command is a command for the framework itself and not tied to any particular document or component. Also notice that test tables often consist of records with varying numbers of fields.
Intermediate-Level Test Tables or Suite Tables do not normally contain such low-level instructions. Instead, these tables typically combine Step Tables into Suites in order to perform more useful tasks. The same Step Tables may be used in many Suites. In this way we only develop the minimum number of Step Tables necessary. We then mix-and-match them in Suites according to the purpose and design of our tests, for maximum reusability.
The Suite Tables are handled by the SuiteDriver module which passes each Step Table to the StepDriver module for processing.
For example, a Suite using two of the preceding Step Tables might look like Table 10:
Suite Table: StartSite | |
STEP TABLE REFERENCE | TABLE PURPOSE |
LaunchSite | Launch web app for test |
Login | Login "MyUserID" to app |
Other Suites might combine other Step Tables like these:
Suite Table: VerifyTOCPage | |
STEP TABLE REFERENCE | TABLE PURPOSE |
VerifyTOCContent | Verify text in Table of Contents |
VerifyTOCLinks | Verify links in Table of Contents |
Suite Table: ShutdownSite | |
STEP TABLE REFERENCE | TABLE PURPOSE |
LogOffSite | Logoff the application |
ExitBrowser | Close the web browser |
High-Level Test Tables or Cycle Tables combine intermediate-level Suites into Cycles. The Suites can be combined in different ways depending upon the testing Cycle we wish to execute (Regression, Acceptance, Performance…). Each Cycle will likely specify a different type or number of tests. These Cycles are handled by the CycleDriver module which passes each Suite to SuiteDriver for processing.
A simple example of a Cycle Table using the full set of tables seen thus far is shown in Table 13.
Cycle Table: SiteRegression | |
SUITE TABLE REFERENCE | TABLE PURPOSE |
StartSite | Launch browser and Login for test |
VerifyTOCPage | Verify Table of Contents page |
ShutdownSite | Logoff and Shutdown browser |
1.3.7 The Core Data Driven Engine:

We have already talked about the primary purpose of each of the three modules that make up the Core Data Driven Engine part of the automation framework. But let us reiterate some of that here.
CycleDriver processes Cycles, which are high-level tables listing Suites of tests to execute. CycleDriver reads each record from the Cycle Table, passing SuiteDriver each Suite Table it finds during this process.
SuiteDriver processes these Suites, which are intermediate-level tables listing Step Tables to execute. SuiteDriver reads each record from the Suite Table, passing StepDriver each Step Table it finds during this process.
StepDriver processes these Step Tables, which are records of low-level instructions developed in the keyword vocabulary of our Component Functions. StepDriver parses these records and performs some initial error detection, correction, and synchronization making certain that the document and\or the component we plan to manipulate are available and active. StepDriver then routes the complete instruction record to the appropriate Component Function for final execution.
Let us again show a sample Step Table record in Table 14 and the overall framework pseudo-code that will process it in Figure 6.
Single Step Table Record | |||
DOCUMENT | COMPONENT | ACTION | EXPECTED VALUE |
LoginPage | UserIDTextbox | VerifyValue | "MyUserID" |
Framework Pseudo-Code |
Primary Record Processor Module: Verify "LoginPage" Exists. (Attempt recovery if not)Set focus to "LoginPage". Verify "UserIDTextbox" Exists. (Attempt recovery if not) Find "Type" of component "UserIDTextbox". (It is a Textbox) Call the module that processes ALL Textbox components. Textbox Component Module: Validate the action keyword "VerifyValue".Call the Textbox.VerifyValue function. Textbox.VerifyValue Function: Get the text stored in the "UserIDTextbox" Textbox.Compare the retrieved text to "MyUserID". Record our success or failure. |
Figure 6
In Figure 6 you may notice that it is not StepDriver that validates the action command or keyword VerifyValue that will be processed by the Textbox Component Function Module. This allows the Textbox module to be further developed and expanded without affecting StepDriver or any other part of the framework. While there are other schemes that might allow StepDriver to effectively make this validation dynamically at runtime, we still chose to do this in the Component Functions themselves.
System-Level Commands or Driver Commands:
In addition to this table-processing role, each of the Driver modules has its own set of System-Level keywords or commands also called Driver Commands. These commands instruct the module to do something other than normal table processing.
For example, the previously shown LaunchSite Step Table issued the LaunchBrowser StepDriver command. This command instructs StepDriver to start a new Browser window with the given URL. Some common Driver Commands to consider:
Common Driver Commands | |
COMMAND | PURPOSE |
UseApplicationMap | Set which Application Map(s) to use |
LaunchApplication | Launch a standard application |
LaunchBrowser | Launch a web-based app via URL |
CallScript | Run an automated tool script |
WaitForWindow | Wait for Window or Browser to appear |
WaitForWindowGone | Wait for Window or Browser to disappear |
Pause or Sleep | Pause for a specified amount of time |
SetRecoveryProcess | Set an AUT recovery process |
SetShutdownProcess | Set an AUT shutdown process |
SetRestartProcess | Set an AUT restart process |
SetRebootProcess | Set a System Reboot process |
LogMessage | Enter a message in the log |
These are just some examples of possible Driver Commands. There are surely more that have not been listed and some here which you may not need implemented.
All for One, and One for All:
This discussion on the Core Data Driven Engine has identified three separate modules (StepDriver, SuiteDriver, and CycleDriver) that comprise the Core. This does not, however, make this three-module design an automation framework requirement. It may be just as valid to sum up all the functionality of those three modules into one module, or any number of discreet modules more suitable to the framework design developed.

1.3.8 The Support Libraries:
The Support Libraries are the general-purpose routines and utilities that let the overall automation framework do what it needs to do. They are the modules that provide things like:
- File Handling
- String Handling
- Buffer Handling
- Variable Handling
- Database Access
- Logging Utilities
- System\Environment Handling
- Application Mapping Functions
- System Messaging or System API Enhancements and Wrappers
They also provide traditional automation tool scripts access to the features of our automation framework including the Application Map functions and the keyword driven engine itself. Both of these items can vastly improve the reliability and robustness of these scripts until such time that they can be converted over to keyword driven test tables (if and when that is desirable).
Comments :
Post a Comment