Quick test professional

QTP Tips QTP codes QTP Faqs and more

General Standards to be followed in Test scripts

General Standards to be followed in Test scripts

  • Indent the code to make it readable and understandable for others.
  • Avoid hard coding system specific values like folder locations, instead set it relatively with respect to the Main/Startup script.
  • Use synchronization functions instead of wait () function.
  • Use GUI checkpoints for all static links, buttons and edit fields in every page (optional)
  • Use parameterization instead of using hard coded data to populate the AUT.
  • All references returned by the AUT must be written to the data table and verified later. These references must be written to the test report as well.
  • All automation steps should be properly commented.
  • All Logic should be commented and explained.
  • The Global data sheet should not be used for importing any test data.
  • The Global sheet should be used only when there are any parameters to be passed in between actions or when certain data has to be maintained through out the test.
  • Use the local sheet to import any test data.
  • All actions except the main calling action are to be reusable action.
  • Declare all variables used in the action in the start of the action itself. While using condition statements to control flow, indent the line, for easy readability.

Test Script Format

 The test scripts are developed using Quick Test Pro tool. The initial action of each subgroup starts the XYZ application and executes the test conditions. Each script executes the test conditions. The expected result is verified with the actual outcome whenever required.  Given below is a sample test script format to be kept in the start of each action


Script Name                             :        ABC_TC01


 ‘Created On                                    

  ‘Referred Test Case Number        :        XYZ_TC_01‘Target Application                     :        XYZ Application‘Purpose / Description                :        To validate the XYZ application ABC functionality‘Data Sheet Name                       :        Global Sheet‘TSR Path                                   :        

 ‘Revision Date                           :        NIL‘Revised By                                :        NIL‘Changes                                    :        NIL ‘*************************************************************************************************************Option Explicit ‘This will FORCE the user to declare the variables Note:XYZ – Application nameABC – Module nameTC – Test Case    

Step Results

 Pass Step Result: Reporter.ReportEvent 0,”Step-1”, “Message: Logged in Successfully”                                       Or Reporter.ReportEvent micPass,”Step-1”, “Message: Logged in Successfully”  Fail Step Result: Reporter.ReportEvent 1,”Step-ER-1”, “Error Message: Log in Failed”                                       Or Reporter.ReportEvent micFail,”Step-ER-1”, “Error Message: Log in Failed”   


  Source: Mercury Forum’s KB articles


February 14, 2008 - Posted by | General Standards to be followed in Test scripts

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: