Sunday, May 24, 2009

Msgbox Vs Print Dialog

Hi All,

You might be familiar with usage of 'Msgbox' in the scripts for displaying the information,Variables,Values.
But from QTP 9.x series HP has introduced a new feature Called "Print" Statement.
The purpose of the Print Statement is similar to Msgbox , see below to have clear picture.
Msgbox:
Msgbox VBScript function is used to display information during the run session.
Note: The run session pauses until the message box is closed.
So while runnings batch testing,Driver scripts we have to make sure that we have not used "Msgbox" in our scripts. The run session pauses until the message box is closed & we cannot expect the test results until run session is completed.
Print :
Print Utility statement is used in our scripts to display information in the QuickTest Print Log window while still continuing the run session.
Note: The run session wouldn't pauses inspite of the display of QuickTest Print Log window.
So while runnings batch testing,Driver scripts if at all we have used 'Print' statements it would not effect the test script execution(Run session) & we would get the test results.
See the below Example
' Using Print Statement:
print "ASCII value of A : "&Asc("A")
print "ASCII value of a : "&Asc("a")
print "ASCII value of B : "&asc("B")
print "ASCII value of b : "&asc("b")

Output:




















Output:

2 comments: