Write your first VBScript using UFT

Write your first VBScript:

In the above video, It is described how you will start a test in UFT and you wrote your first script. The code in the script is given below:
intNum1 = 10
intNum2 = 20
intRes = intNum1 + intNum2
print “Sum = “&intRes
print “Hello All”

Useful areas in UFT Screen:
Basic Code Window

Print Command: “Print” is used to display anything in the output window. For example if you want to display the message “Hello”, then you will use the following statement:

Print “Hello”

The above line is a vbscript statement. Consider the piece of code below:

strName = “David”

Print strName

Print “My name is: ”&strName

There are three statements above and it will display:



My name is: David


& is called ampersand operator

Go Back to UFT Tutorials Homepage