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
Functions
- 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
1 Comment »
Leave a comment
-
Archives
- July 2011 (1)
- March 2011 (1)
- November 2010 (1)
- November 2008 (4)
- October 2008 (2)
- September 2008 (2)
- June 2008 (1)
- March 2008 (4)
- February 2008 (44)
-
Categories
- Automated Test Script Creation Process
- Automating MS Word
- Automating QC
- Automation Object Model For QTP
- Backward compatability in QTP
- Browser Scripts
- COM and QTP
- compare 2 text files
- Descriptive programming
- Descriptive Programming and Child Objetcs
- Dictonary Object
- DotNetFactory
- Excel Automation
- Extra Topics
- Files and Folders
- General Standards to be followed in Test scripts
- New Features In QTP9.5
- QC-OTA
- QTP Additional Faqs
- QTP Faqs
- QTP Naming Convention
- QTP Tips and Faqs
- Running stored procedures from QTP
- Send keyboard keys
- Uncategorized
- Uninstall a software using QTP
- Uninstall a software using vbscript
- Update data in a database
- VBScript and IE Automation
- VBScript Faqs and Useful resources
- What’s New in Quick Test Pro 9.0
- Whats New in QTP 9.5
- XML Scripting
-
RSS
Entries RSS
Comments RSS
‘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 |