Quick test professional

QTP Tips QTP codes QTP Faqs and more

QTP Naming Convention

QTP Naming Convention 


Notation to Be Used For Automation Objects

 Checkbox = chk                                                      Dialog Box = dbDisplay = displ                                                         Icon = icLabel = lbl                                                              Links = linkList Box = lb                                                           List View = lvLogo = logo                                                            Menu = mMenu Item = mi                                                       Message Box = mbPopup List = poplst                                                  Push Button = pbRadio Button = rb                                                    Scroll Bar = sbStatic Text = stxt                                                    Status Bar = stbrTab = tab                                                               Table = tblText Box = txt                                                         Tool Bar = tbTree View = tv                                                       Header = hdrPanel = pan                                                             Status Window = stwinSplitter = sp                                                            Container = ctnNavigation bar = nb                                                 Grid = grdCombo box = cbx                                                    Window = win         

Test Scripts

 The test scripts name

  • Must consist of alphabets, numbers and ‘_’.
  • Must start with an upper case letter.
  • If more than one word is used, the starting of every word must be in Upper case.      (Eg: Test_Script)
  • Name of the script must be in the format – Application/Test group, Feature/Action Number (XYZ_01).


VBS Files

  • A  VBScript file name must consist of alphabets.
  • Name should preferably be in the format Project_Module_Function



  • Must consist of alphabets.
  • Must start with ‘func’.
  • Name must stand for the functionality of the function.
  • If more than one word is used, the starting of every word should be in capitals.
  • Numerical are not allowed in the names

          Eg:  Public function funcOpenWindow (in window_name) 

 Constants and Variables

  • Name of a constant must be in upper case letters with underscores in it.  Eg: public const OR_PATH_DIR= c:\\mytests\\Action1; 
  • Name of a variable must be of lowercase letters and can contain underscores and digits. Eg: public my_variable_name=”This is my variable”;

·        Declare all the variables using DIM.

Object Repository

  • Object repository file name must consist of alphabets and should be like project_Module_Function.tsr.
  • If the name of an object or window is ambiguous, then it must be renamed in the format ObjectType_Label. Eg: Button_Done, Window_EngagementSummry, Checkbox_Overage, Radio_Awarded etc.
  • If more than one word is used, the starting of every word should be in capitals.


Recovery Manager

  • Name of a Recovery Manager file must be of alphabets and if necessary digits.
  • The files must be of the format Project_Module_Function_in.qrs.


  Source: Mercury Forum’s KB articles


February 14, 2008 - Posted by | QTP Naming Convention

1 Comment »

  1. ‘How to rename and delete a Action?

    Dim qtApp ‘As QuickTest.Application ‘ Declare the Application object variable
    Dim qtRepositories ‘As QuickTest.ObjectRepositories ‘ Declare an action’s object repositories collection variable
    Dim lngPosition

    ‘ Open QuickTest
    Set qtApp = CreateObject(“QuickTest.Application”) ‘ Create the Application object
    qtApp.Launch ‘ Launch QuickTest
    qtApp.Visible = True ‘ Set QuickTest to be visible

    ‘ Open a test and get the “Login” action’s object repositories collection
    qtApp.Open “C:\Tests\Test1”, False, False ‘ Open a test
    Set qtRepositories = qtApp.Test.Actions(“Login”).ObjectRepositories ‘ Get the object repositories collection object of the “Login” action

    Comment by Thangaraj | December 23, 2009 | Reply

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: