Tuesday, August 25, 2009

Limitations of QTP

Limitations to display on QTP Print log window:

We are familiar with Print command in VB Script that is use to display the output lines in Print Log window. This is very similar to printf in C++ and System.out.print commands in Java.

Syntax: Print “text”

QTP Print log (Quick Test Print Log) window can write 1001 lines on it and 1024 characters in a line. So it has array of (1001 X 1024). If you enter more lines the previous lines will be deleted and most recent lines will be displayed. So it can handle 1001*1024= 1,025,024 characters to display at a time.





Limitations to Display on QTP Message dialog window:

We also very much familiar with Msgbox command in VB Script that is use to display output message in Message Dialog Window with ok button.

Syntax: Msgbox “text”

The maximum length of characters Prompt is exactly 1023 characters. But it might depend also on the width of the characters used. If Prompt consists of more than one line, you can separate the lines using a carriage return character (Chr(13)), a line feed character (Chr(10)), or a carriage return/linefeed character combination (Chr(13) & Chr(10)) between each line.

This has been tested with the following code:

Dim Num
Num=RanNumber(1023)
print Num
msgbox Num

Function RanNumber(val)
Dim d
Set d=nothing
Set d = createobject("Scripting.Dictionary")
For i =1 to val
r=RandomNumber (0,9)
d.add i, r
Next
a = d.items 'Get the items.
For i = 0 To d.Count -1 ' Iterate the array.
s = s&a(i)'Create return string.
Next
RanNumber=s
End Function


No comments:

Post a Comment