
I recommend you to subscribe by email below and have new UFT articles sent directly to your inbox. If you want to keep track of further articles on UFT (QTP).

Now you may go to VB Script and QTP – Part 2 In the next post we will deal with constructs and arrays and various ways of looping in QTP(UFT). Within procedures, constants are always private their visibility can’t be changed. Also note that constants are public by default. Note that the string literal is enclosed in quotation marks (” “). For example: Const MyString = "This is my string."Const MyAge = 49 Using the Const statement, you can create string or numeric constants with meaningful names and assign them literal values. You create user-defined constants in VB Script using the Const statement. VB Script in itself has a number of defined intrinsic constants like vbOK, vbCancel, vbTrue, vbFalse and so on. ConstantsĪ constant is a meaningful name that takes the place of a number or a string, and never changes. This kind of array is called a fixed-size array.
VB SCRIPTING FOR UFT TUTORIAL PLUS
In a zero-based array, the number of array elements is always the number shown in parentheses plus one. In the following example, a single-dimension array containing 11 elements is declared: Dim A(10)Īlthough the number shown in the parentheses is 10, all arrays in VB Script are zero-based, so this array actually contains 11 elements. Array variables and scalar variables are declared in the same way, except that the declaration of an array variable uses parentheses ( ) following the variable name.
VB SCRIPTING FOR UFT TUTORIAL SERIES
Then you can create a variable that can contain a series of values. Other times, it is convenient to assign more than one related value to a single variable. A variable containing a single value is a scalar variable. Much of the time, you only want to assign a single value to a variable you have declared. Values are assigned to variables creating an expression as follows: the variable is on the left side of the expression and the value you want to assign to the variable is on the right.

VB Script supports only one data type called Variant. Even if you do not know Visual Basic, once you learn VB Script, you are on your way to programming with the whole family of Visual Basic languages.) Data types (If you already know Visual Basic or Visual Basic for Applications (VBA), VB Script will be very familiar. VB Script can be used to write both server side and client side scripting.

It was developed by Microsoft to provide more processing power to Web pages. VB Script is a subset of Visual Basic 4.0 language. It will start from the basics of VB Script and move to the advanced course. Going forward, I am starting a series of posts on using VB Script with QTP.
