What stages we need to pass through for Keyword Driven Testing in QTP?
With the help of keyword-driven testing approach we can bifurcate most of the programming activities from the actual testing activities. This way testers can create their tests much earlier and are able to efficiently manage the application with just small updates even when the application undergoes significant.
The entire test creation process using keyword-driven methodology involves following two stages:
Stage – 1: Creation of a set of resources for testing or an infrastructure for the test automation.
Stage – 2: Creation of desired tests using the Keyword View of QTP. Here we select different keywords � which can be either objects or can be an operation
describing the functionality of the application under test.
The process of creating an infrastructure for the test automation further involves two stages like:
1) Planning stage
2) Implementation stage
1) Planning Stage: Involves following activities
a) Carrying out a complete analysis of the application and identification of objects and operations being used by the business processes under the test.
b) Identification of the operations needing special keywords which become essential for providing some added functionality. This would further provide more clarity on business-level, and would enhance the maintainability as well as the operational efficiency.
2) Implementation Stage: Involves following activities
1) Creating all objects in the object repository with easily identifiable & unique names designated by following recognized object naming conventions. This will help the automation engineers to easily recognize these objects without any ambiguity. In our application, we can define our object either manually or by using the built-in functionality of QTP. It is essential to ensure that our object repository using the automation infrastructure must have all objects concerned with the tests.
2) Creating special keywords in function libraries at business level & creating their relevant documentation.
Here we develop customized or specialized functions for our application under test. In some cases we may find the need to create special functions to test some functionality of the application not included in the out of the box object model of QTP. We may like to combine different functions & existing methods for creating specialized functions, which would test the sequences or operations commonly, performed in the application. During the stage of test creation, all these newly created functions are available to us as extra keywords or as substitute for keywords already built-in QTP.
Since keyword-driven testing involves more initial time investment & better planning compared to straightaway recording of steps, the process of test creation and maintenance becomes more convenient & efficient. In addition it helps us in maintaining a more readable structure of the tests which can be easily modified at any stage.
We can encapsulate large portion of complex programming within function libraries, and can make such functions quite flexible thereby enabling their use in several testing scenarios. Here an expert on automation can design specialized keywords, while the same can be used in different tests by several application testing engineers with lesser technical expertise.
With this approach we can update our testing functionality without the need to update all the concerned tests utilizing the particular keywords.
For a particular application we include all the relevant objects in single shared object repository, which can be associated with many relevant tests. This helps us in easily reflecting the changes in the object repository without any need for updating all the individual tests.
Once our inventory of object & function library keywords is available, keyword-driven tests can be created by the application testing engineers using such keywords.
Keyword-driven methodology drives advantages over recording, which is largely dedicated to some particular procedure only. This involves re-recording of large portion of tests in case of significant changes in the application say when changes take place during version upgrades.
The prime advantage of test creation using keyword-driven methodology is that the resulting tests are more modular & convenient & they focus on built-in keywords of QTP as well as our own customized keywords during the test. Moreover this helps us in starting the automated keyword-driven testing even before the new build having new objects is ready.
Many More articles on Test Automation Frameworks
An expert on R&D, Online Training and Publishing. He is M.Tech. (Honours) and is a part of the STG team since inception.