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‘
Author :
‘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
-
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