Comments in UFT Tests


Comments in UFT Tests

Comments in VBScript

i) Purpose of Comments   
    

    To make the code Readable
    To make the code disable from execution
------------------------------------
ii) Comments Syntax in VBScript:
    

    Use ' Symbol before the Statement

    Or

    Use Rem command followed by space

Example:
Dialog("Login").Activate 'Select Login Dialog box
'Dialog("Login").WinEdit("Agent Name:").Set "asdf"
Rem Dialog("Login").WinEdit("Password:").Set "mercury"
------------------------------------
iii) Comment a block of Statements
 

> Select Statements

> Use Ctrl + M

Or

> Select Statements

> Edit menu > Format > Comment
------------------------------------
iv) Uncomment

> Select Comment block

> Use Ctrl + Shift + M

Or

> Select Comment block

> Edit menu > Format > Uncomment
----------------------------------------
v) Usage of Comments in UFT
 

a) To write Test headers
 
'************************************************
'Test Name:
'Author:
'Date of Creation:
'Date of Modification:
'Pre-requisites:
'Test Flow:

'************************************************


b) To write Function Headers

 
'************************************************
'Function Name:
'Author:
'Date of Creation:
'Date of Modification:
'Input:
'Output:
'Purpose:

'************************************************
c) To Explain the complex logic.

d) To Explain the resources usage.

 ------------------------------------

0 comments:

Post a Comment