Saturday, May 21, 2011

Test Library Architecture QTP Framework.


It is also know as "Structured Scripting" or "Functional Decomposition".



In this Framework,


  1.  Test scripts are initially recorded by “Record & Playback” method. 
  2.  Common tasks inside the scripts are identified and grouped into Functions.
  3.  These Functions are called by main test script called Driver in different ways to create test cases.


Advantages:

  1. Higher level of code reuse is achieved in Structured Scripting as compared to “Record & Playback”.
  2. The automation scripts are less costly to develop due to higher code re-use.
  3. Easier Script Maintenance(Common functionality need to modify at one place only). 

Disadvantages:

  1. Technical expertise is necessary to write Scripts using Test Library Framework. 
  2. More time is needed to plan and prepare test scripts. 
  3. Test Data is hard coded within the scripts(data tables are not used). 

Example:


Function for logging in to an application will look like:

Function Login()

Dialog("Login").WinEdit("Userame:").Set "Ankur"

Dialog("Login").WinEdit("Password:").Set "Password1"

Dialog("Login").WinButton("OK").Click

End Function 


Now, we can call this function in the main script as follows

'Driver Script

Call Login()


No comments:

Post a Comment

Search This Blog