Understand Keyword Driven Framework by using UFT – (Part 1)

Framework is to automation as beauty is to Nature. Amazing thing about our mother nature is that it brings happiness and rejuvenates our energy level, similarly framework makes our automation task more manageable and brings elegance in coding.Today we would be focusing on the fundamental architecture of the framework. We would be beginning with Keyword driven framework and then we would polish it as our Hybrid framework.

We wonโ€™t be discussing much of theory but would be doing lot of coding ๐Ÿ™‚

We have divided this topic into 3 Part Tutorial :-

  1. Part1 (Current post, it contains the Working copy of the code + Architecture of the Framework)
  2. Part2(It consists of Driver Script + Function Lib’s + Recovery Scenario + Object Repository)
  3. Part3(Keyword Sheet creation + Run Results)

Working hard for something we don’t care about is called stress; working hard for something we are passionate about is called Loveโ€. So in case one loves automation we would always we improving framework. We always believe that no framework is perfect and everything is requirement based.Do share your comments and knowledge so it is beneficial for our fellow coders,We can also be in touch through Fb,G+,Twitter or Email.

Note: – In our previous post we discussed various components of framework but in the below code we are just implementing the basic flow. we can further segregate them as per our requirement,to add more modularity.

Please download the code and follow the tutorial to get hold of this framework.


Note:- After downloading the coding -> Extract the zip files -> open the “KeywordApproach” folder -> paste inside c:Temp -> open the Driver script in UFT/QTP.

Keyword Driven framework folder structure
Folder structure of the Keyword Driven Framework



Key Components:-

Driver Script:-
This is our driving component, it contains the call to other components (Functions)

Function Library:-
This contains our functions, which we have segregated based on the operation level:-

  • Main Lib: – This contains our framework level functions, which further call the other libraries.
  • Keyword Lib: – This contains the functions which defines our Keywords in the Keyword Sheet.
  • Excel Lib: – This library contains the Excel level functions like to fetch data or write data into excel.

Keyword Sheet:-
It consists of our keyword data, which are taken as input to our framework to initiate action on the application.

Recovery Scenario:-
We have added the “ApplicationCrash” recovery scenario, which re-run our test, incase our application(we have taken chrome and IE) crashes.

Object Repository:-
Repository of our objects used in the framework.
Note: – We would be using special naming conventions for each type of object, this is also part of our framework.

Flow Diagram:-

Flow diagram for Keyword Driven Framework
Flow of Keyword Driven Framework

1.Driver Script interacts with Excel Lib.
2.Excel Lib fetch number of rows to be run from “Keyword Sheet” i.e our data sheet.
3.Driver interacts with Main Lib
4.Main Lib with the help of Excel Lib it fetch the data from “Keyword Sheet” for the first row into a array
5.Keyword lib creates the heiarchy of object like browser.page.object
6.Object is fetched from OR
7.Final action is performed on the Application under Test (AUT)

Note:-RS inthe flow diagram, refers to recovery scenario to handle exceptional scenarios.

Summary:-
So far we did basics about the key components of the  Framework and then we integrated them in a flow to form a Keyword Driven Framework architecture, in our next post we would be creating each of these individual components to get a workable copy of the “Keyword Driven Framework

Understand Keyword Driven Framework by using UFT – (Part 2)
Understand Keyword Driven Framework by using UFT – (Part 3)
Hybrid Framework!!

Do follow us on Fb,G+,Twitter for more topics.

ufthelp

Leave a Reply

Your email address will not be published. Required fields are marked *