In QTP Keyword Driven Testing versus Recording – Which one to choose?

Tests can be created in QTP with the help ofcan lay their focus on the maintenance of design
Recording or by using Keyword-driven methodology or& test structure, while the automation engineers
by a combination of both of them.can concentrate on maintenance of functions and
Following are some of the situations wherein each oneobjects.
of these approaches are beneficial. Accordingly we4) We keep on adding new objects in the local object
can decide as to whether to go in for Keyword-drivenrepositories while recording the tests. This way there is
testing or recording for our application.great probability that different testers will create their
Recording is beneficial especially in situations like:own local object repositories having multiple copies of
1) Recording is quite helpful to the beginners. Due to itsthe same object. The advantage of keyword-driven
simplicity, even a novice user is able to understand themethodology is that we pick up the desired objects
mechanism as to how QTP understands various setfrom an already existing object repository for inclusion
of operations performed by the user on the applicationin our steps. In case of need, we can add any new
and how it converts them to its objects and its ownobject to the local object repository on a temporary
operations.basis & the same can be transferred to the
2) Not only the beginners, even the advanced usersshared object repository for use later on.
find recording quite beneficial while handling some new5) During recording a test, the desired objects,
features added to an application or managing a newmethods & arguments are automatically added by
application altogether. With recording we can easilyQTP. This way QTP helps us in test creation with
develop functions using built-in keywords of QTP.great ease & with lesser planning &
3) We can exploit the recording feature of QTP whenpreparations. Though we are able to quickly create
there is an urgent need for creating some tests aimedtests with this approach, but these tests are
at testing some application or its feature especiallycumbersome to maintain in case changes take place in
when there is no necessity of its maintenance on athe application. In such case fresh recording of major
long-term.portions of the test become necessary.
Keyword-driven methodology is advantageous inWhereas already existing operation keywords &
situations like:objects are chosen while using keyword-driven testing.
1) Using keyword-driven methodology instead ofHence the tester needs to be fully conversant with
creating tests at the object level, we can create themalready available inventory of function libraries as well
at a business level.as object repositories. Moreover the tester is required
For instance, in an application, QTP would recognize ato have good understanding of his requirements from
single option selection, as many individual steps like -the test prior to the process of adding steps.
clicking an object like a button, operation of mouseThis is the reason that well-planned, nicely structured
over a list or input from the keyboard on a sub-item of& easily maintainable tests emerge out of
the list. Here we can easily create a function, withkeyword-driven testing.
easily identifiable name, which would cover all such6) While following keyword-driven methodology, based
operations of lower level clubbed in one keyword atupon the detailed product specifications, the automation
the business-level.engineers are able to add objects and functions even
2) With the help of keyword-driven methodology, webefore the inclusion of a particular feature in the
can use specialized operations like synchronizationproduct.
statement for higher level keywords, say in a case,7) By using keyword-driven methodology we can start
where the system is made to wait till thethe development of tests for a new product or its
communications of client-server finishes. Such testsfeatures much earlier in its development cycle.
become quite easy for execution & interpretationConclusion: As compared to recording, the
by even less skilled testers & even thekeyword-driven testing is generally more time
maintenance becomes easy when changes takeconsuming & resource consuming. However once
place in the application.all the tests for some particular application are created,
3) We can easily bifurcate test maintenance andthey can be managed & maintained with more
resource maintenance with the help of keyword-drivenflexibility and efficiency as compared to the recorded
testing. With such a separation, the application testerstests.