Sunday, May 22, 2011

Data-Driven QTP Framework.


In this Framework,
  1.  Test case logic resides in Test Scripts.
  2.  Test Data is separated and kept outside the Test Scripts.
  3.  Test Data is read from the external files.
  4.  The external files may be Excel Files, Text Files, CSV Files, ODBC Sources, DAO Objects etc)
  5.  The external files are loaded into the variables inside the Test Script. 
  6.  Variables are used both for Input values and for Verification values.
  7.  Test Scripts themselves are prepared either using Linear Scripting or Test Library Framework.
Advantages:
  1.  Changes to the Test Scripts do not affect the Test Data.
  2.  Test Cases can be executed with multiple Sets of Data.
  3. A Variety of Test Scenarios can be executed by just varying the Test Data in the External Data File.
Disadvantages :
  1.  More time is needed to plan and prepare both Test Scripts and Test Data.

Example :

Developing  Login script using this method will involve two steps.

 Step 1) Create a Test - Data file which could be Excel , CSV , or any other database source.
  
Username                 Password
Ankur                        Password1
Ankit                         Password2
Ashu                         Password3 

  
Step 2) Develop Test Script and make references to  test data source.
  
Dialog("Login").WinEdit("Username:").Set DataTable("Username", dtGlobalSheet)

Dialog("Login").WinEdit("Password:").Set DataTable("Password", dtGlobalSheet)

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


No comments:

Post a Comment

Search This Blog