Interview Questions   Tutorials   Discussions   Programs   Videos   

QTP - Can anybody Explain me about Automation framework? How can we prepare Automation Framework using QTP?

asked marvit August 30, 2014 02:25 AM  

Can anybody Explain me about Automation framework? How can we prepare Automation Framework using QTP?


1 Answers

answered By Dharma   0  
Automation Framework

In the context of successful implementation of QTP for a software testing project we often come across the concept of frameworks. Framework is nothing but the approach that we consistently follow during the automation process – a set of guidelines.

Personally, I don’t like to give names and say that one works better than the other. The selection of a certain framework is not the beginning of a project. It is the reverse that is true. In the process of devising a testing strategy you build the rules that are applicable to the tester’s current situation and that right there is your framework.

Having said that, the following are some of the important points we need to consider:

    Script’s easy maintenance
    Readability of scripts
    Good workable folder structure for all the test assets
    No hard coding values
    No cascade of failures. (i.e. if one test fails, it should not cause the failure or stopping of the others)

This is the basic list and more can be added based on the requirement.

Any testing strategy that tries to incorporate some or all of these above points is your Test Automation Framework.

types of automation frameworks

    Linear – Simplest form of creating a test. Just write a one single program without modularity in sequential steps
    Keyword driven – Create different keywords for different set of operations and in the main script we can just refer to these keywords.
    Data driven – To run same set of operations on multiple sets of data that are kept in separate files, mostly excel sheets.
    Hybrid – A combination framework that can be partly data driven and partly keyword driven
    BPT – This just means that programs are broken down into business components and are used with one or the other of the above types of frameworks

Linear Framework

As discussed this approach involves simply writing the code as we record and keep going.

For example, if the operation that you have to verify is the creation of a new account in gmail the following will be the steps:

a) Open
b) Click on ‘Create Account’
c) Enter the details
d) Verify the details
e) Create the account

'Open GMail
SystemUtil.Run "iexplore.exe", ""
'Page Sync
‘Click on create account
Browser("Gmail").Page("Gmail").WebLink(“Create Account”).Click
‘Enter the details
Browser("Gmail").Page("Google Accounts").WebEdit(“First Name”).Set “Swati”
Browser("Gmail").Page("Google Accounts").WebEdit(“Last Name”).Set “test”
‘Fill in several other details
Browser("Gmail").Page("Google Accounts").WebButton(“Next Step”).click

The above is an example of how a program that uses the linear method looks like. It is obvious at this point what the advantages and disadvantages of this method are.


    Simplicity. For beginner programmer this method is apt
    Time – It does not take a lot of time to create the test
    Very little planning is required


    No reusability at all
    If there is another script that verifies a certain aspect of the ‘Google Accounts’ Page then you will have to rewrite the code to launch page too. So lots of repetition.
    All the data is directly embedded into code. The hard coding does not let the code be used for any other set of data.
    Error prone and maintenance is difficult

While the cons outweigh the pros, this method can be used when your aim is strictly to accomplish a task without validations.

The components or test assets in this kind of frameworks are:

    Test script
    Object repository (This can be avoided by using descriptive programming if needed)

   add comment

Your answer

Join with account you already have



Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!