Software Testing Experience

Wednesday, April 9, 2008

Keyword Driven Testing Framework


Keyword Driven Testing


Mercury QuickTest Professional is the advanced solution for functional test and regression test automation. This next-generation automated testing solution deploys the concept of keyword-driven testing to enhance test creation and maintenance. Keyword-driven testing is a technique that separates much of the programming work from the actual test steps so that the test steps can be developed earlier and can often be maintained with only minor updates, even when the application or testing needs change significantly.


Using the keyword-driven approach, test automation experts have full access to the underlying test and object properties, via an integrated scripting and debugging environment that is round-trip synchronized with the Keyword View.


You create a test either by building an object repository and adding steps manually or by recording a session on your application. You can create steps using the table-like, graphical Keyword View using keyword-driven functionality—or you can use the Expert View, if you prefer programming steps directly in VBScript.


The Keyword View enables you to create and view the steps of your test in a keyword-driven, modular, table format. The Keyword View is comprised of a table-like view, in which each step is a separate row in the table, and each column represents different parts of the steps. You can modify the columns displayed to suit your requirements. You create and modify tests by selecting items and operations in the Keyword View and entering information as required. Each step is automatically documented as you complete it, enabling you to view a description of your test steps in understandable English.


You can design tests using the keyword-driven methodology, step recording, or a combination of both.

In comparison to recording, the keyword-driven methodology generally requires a longer time-investment and at least one automation expert with a high-level of QuickTest expertise to prepare the infrastructure required for your tests, but once the infrastructure is in place, tests can be created at a more application-specific level and with a more structured design. Additionally, all the tests for a given application can be maintained more efficiently and with more flexibility than a recorded test.


Creating a Test Using the Keyword-Driven Methodology


Keyword-driven testing is a technique that separates much of the programming work from the actual test steps so that the test steps can be developed earlier and can often be maintained with only minor updates, even when the application or testing needs change significantly. The keyword-driven testing methodology divides test creation into two stages:
Preparing a set of testing resources (the test automation infrastructure).






Planning Stage


Implementation Stage



Although this methodology requires more planning and a longer initial time-investment than going directly to the test creation stage and recording your steps, this methodology makes the test creation and test maintenance stages more efficient and keeps the structure of individual tests more readable and easier to modify.

By encapsulating much of the complex programming into function libraries, and by making these functions flexible enough to use in many testing scenarios (through the use of function parameters that control the way the functions behave), one or a few automation experts can prepare the keywords that many application testers who are less technical can include in multiple tests. This also makes it possible to update testing functionality without having to update all the tests that use the keywords.


In a similar fashion, by maintaining all objects that are relevant to a particular application or area of an application within one shared object repository, and by associating that object repository with all relevant tests, changes to the application can be reflected in the object repository without the need to update tests.

After the object and function library keywords are ready, application testers can use these keywords to build keyword-driven tests.


Recorded tests tend to be specific to a single procedure or set of procedures. When the application changes, especially when it changes significantly from one version to another, much of the test often needs to be rerecorded.


By creating your tests with a keyword-driven methodology in mind, your tests become more modular, focusing on the operations to test using both QuickTest built-in keywords and your own user-defined keywords. Additionally, because it is possible to add objects to the object repository before they exist in an application, it is possible to begin preparing your automated keyword-driven tests even before a build containing the new objects is available.

Developing a Keyword-Driven Automation Infrastructure

One or a few automation experts usually develop the test automation infrastructure that all tests related to a certain application or functionality will use. The automation infrastructure usually includes one or more shared object repositories and one or more function libraries. The information in the sections below gives you some guidance on the main tasks involved in creating these resources and describes where you can find detailed documentation for these tasks. After the test automation infrastructure is ready, the application testers can begin designing their keyword-driven tests by selecting objects and operation keywords in the Keyword View.


Creating a Shared Object Repository

The tasks involved in creating a shared object repository for the test automation infrastructure can include:


Creating a Function Library

The tasks involved in creating a function library for the test automation infrastructure can include:


Note: Although not directly associated with the keyword-driven methodology, the automation experts who maintain the object repositories and function libraries also often maintain a set of recovery scenarios that all application testers can associate with their tests.


Deciding When to Use the Keyword-Driven Methodology

You can create the steps in your tests using the keyword-driven methodology, recording, or a combination of both. Recording can be useful in the following situations:



Labels:

posted by Balaji Visharaman at 10:28 PM

0 Comments:

Post a Comment

<< Home