Steps to write VBScript program:
1. Vartype function returns the subtype of a variable and it is in form of numbers.
2. The Number indicates the following variables:
0 = vbEmpty
1 = vbNull
2 = vbInteger
3 = vbLong
4 = vbSingle
5 = vbDouble
6 = vbCurrency
7 = vbDate
8 = vbString
9 = vbObject
10 = vbError
11 = vbBoolean
12 = vbVariant
13 = vbDataObject
17 = vbByte
8192 = vbArray
QTP Code to Find Variable Type :
<html>
<body>
<script type="text/vbscript">
myvar="www.SoftwareTestingNet.com"
msgbox VarType(myvar)
myvar=4
msgbox VarType(myvar)
myvar=True
msgbox VarType(myvar)
</script>
</body>
</html>
Output of myvar=www.SoftwareTestingNet.com
Output of myvar=4
Output of myvar=True
Where to Run This Program:
1. This VBScript Program code either you can use in QTP editor (code between <script> and </script> tags ) and run it.
2. Write in Notepad, save with .htm extension and run on internet explorer.
0 comments:
Post a Comment