Professional Documents
Culture Documents
Advanced QTP: (In Vbscript Orientation)
Advanced QTP: (In Vbscript Orientation)
com
Advanced QTP
(In VBScript Orientation)
1) Introduction
2) Comments
3) VB Script Variables
4) VB Script Data Types
5) VB Script Operators
6) Input/Output Operations
7) Constants
8) Conditional Statements
9) General Examples
10)Loop Through Code
11)Procedures
12)Built-In Functions
13)VBScript syntax rules and guidelines
14)Errors
15)File System Operations
16)Test Requirements
17) Solutions
18)QTP Add-Ins Information
19) VBScript Glossary
www.gcreddy.com
When a VBScript is inserted into a HTML document, the Internet browser will read the HTML
and interpret the VBScript. The VBScript can be executed immediately, or at a later event.
Microsoft Visual Basic Scripting Edition brings active scripting to a wide variety of
environments, including Web client scripting in Microsoft Internet Explorer and Web server
scripting in Microsoft Internet Information Service.
1.1 Windows Script Host (WSH)
It is a Windows administration tool. WSH creates an environment for hosting scripts.
That is, when a script arrives at your computer, WSH plays the part of the host it makes
objects and services available for the script and provides a set of guidelines within which the
script is executed. Among other things, Windows Script Host manages security and invokes
the appropriate script engine
Windows Script Host is built into Microsoft Windows 98, 2000, and Millennium Editions and
higher versions.
A Windows script is a text file. We can create a script with any text editor as long as we
save our script with a WSH-compatible script extension (.js, vbs, or .wsf).
The most commonly available text editor is already installed on our computer Notepad.
We can also use your favorite HTML editor, VbsEdit, Microsoft Visual C++, or Visual
InterDev.
1.2 Creating a script with Notepad
1.Start Notepad.
2.Write your script. For example purposes, type Msgbox "Hello VB Script"
3.Save this text file with a .vbs extension (instead of the default .txt extension). For
example, Hello.vbs
4.Navigate to the file you just saved, and double-click it.
5.Windows Script Host invokes the VB Script engine and runs your script. In the example, a
message box is displayed with the message "Hello VB Script"
1.3 Hosting Environments and Script Engines
Scripts are often embedded in Web pages, either in an HTML page (on the client side) or in
an ASP page (on the server side).
www.gcreddy.com
www.gcreddy.com
Comments
The comment argument is the text of any comment we want to include.
2.0 Purpose of comments:
o
We can use comments for making one or more statements disable from execution.
2.1 Syntax
Rem comment (After the Rem keyword, a space is required before comment.)
Or
Apostrophe (') symbol before the comment
2.2 Comment/Uncomment a block of statements
Select block of statement and use short cut key Ctrl + M (for comment)
Select comment block and use short cut key Ctrl + Shift + M (for uncomment)
2.3 Example
www.gcreddy.com
VB Script Variables
A variable is a convenient placeholder that refers to a computer memory location where we
can store program information that may change during the time our script is running.
3.1 Declaring Variables
We declare variables explicitly in our script using the Dim statement, the Public statement,
and the Private statement.
For example:
Dim city
Dim x
We declare multiple variables by separating each variable name with a comma. For
Example:
Dim x, Top, Bottom, Left, Right
We can also declare a variable implicitly by simply using its name in our script. That is not
generally a good practice because we could misspell the variable name in one or more
places, causing unexpected results when our script is run. For that reason, the Option
Explicit statement is available to require explicit declaration of all variables.
The Option Explicit statement should be the first statement in our script.
3.2 Option Explicit
Forces explicit declaration of all variables in a script.
Option Explicit ' Force explicit variable declaration.
Dim MyVar ' Declare variable.
MyInt = 10 ' Undeclared variable generates error.
MyVar = 10 ' Declared variable does not generate error.
3.3 Naming Restrictions for Variables
Variable names follow the standard rules for naming anything in VBScript. A variable name:
o
www.gcreddy.com
When we declare a variable within a procedure, only code within that procedure can access
or change the value of that variable.
If we declare a variable outside a procedure, we make it recognizable to all the procedures
in our script. This is a script-level variable, and it has script-level scope.
3.5 Life Time of Variables
The lifetime of a variable depends on how long it exists.
The lifetime of a script-level variable extends from the time it is declared until the time the
script is finished running.
At procedure level, a variable exists only as long as you are in the procedure.
3.6 Assigning Values to Variables
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.
For example:
A = 200
City = Hyderabad
X=100: Y=200
3.7 Scalar Variables and Array Variables
A variable containing a single value is a scalar variable.
A variable containing a series of values, is called an array variable.
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.
Example:
Dim A(3)
Although the number shown in the parentheses is 3, all arrays in VBScript are zero-based,
so this array actually contains 4 elements.
We assign data to each of the elements of the array using an index into the array.
Beginning at zero and ending at 4, data can be assigned to the elements of an array as
follows:
A(0)
A(1)
A(2)
A(3)
=
=
=
=
256
324
100
55
www.gcreddy.com
Similarly, the data can be retrieved from any element using an index into the particular
array element you want.
For example:
SomeVariable = A(4)
Arrays aren't limited to a single dimension. We can have as many as 60 dimensions,
although most people can't comprehend more than three or four dimensions.
In the following example, the MyTable variable is a two-dimensional array consisting of 6
rows and 11 columns:
Dim MyTable(5, 10)
In a two-dimensional array, the first number is always the number of rows; the second
number is the number of columns.
3.8 Dynamic Arrays
We can also declare an array whose size changes during the time our script is running. This
is called a dynamic array.
The array is initially declared within a procedure using either the Dim statement or using the
ReDim statement.
However, for a dynamic array, no size or number of dimensions is placed inside the
parentheses.
For example:
Dim MyArray()
ReDim AnotherArray()
To use a dynamic array, you must subsequently use ReDim to determine the number of
dimensions and the size of each dimension.
In the following example, ReDim sets the initial size of the dynamic array to 25. A
subsequent ReDim statement resizes the array to 30, but uses the Preserve keyword to
preserve the contents of the array as the resizing takes place.
ReDim MyArray(25)
ReDim Preserve MyArray(30)
There is no limit to the number of times we can resize a dynamic array, although if we make
an array smaller, we lose the data in the eliminated elements.
www.gcreddy.com
www.gcreddy.com
Description
Raises a number to the power of an exponent
Multiplies two numbers.
Divides two numbers and returns a floating-point
result.
Divides two numbers and returns an integer result.
Divides two numbers and returns only the remainder.
Sums two numbers.
Finds the difference between two numbers or indicates
the negative value of a numeric expression.
Forces string concatenation of two expressions.
Description
Used to compare expressions.
Used to compare expressions.
www.gcreddy.com
Object equivalence
2) Concatenation
Operator (&)
Description
Sums two numbers
If
Then
1) Both expressions are numeric
Add.
2) Both expressions are strings
Concatenate.
3) One expression is numeric and the
Add.
other is a string
Forces string concatenation of two expressions.
Description
Performs logical negation on an
expression
Performs a logical conjunction on two
expressions.
Performs a logical disjunction on two
expressions.
Performs a logical exclusion on two
expressions.
Performs a logical equivalence on
two expressions.
Syntax
result= Not expression
www.gcreddy.com
result= expression1
expression2
result= expression1
expression2
result= expression1
expression2
result= expression1
expression2
And
Or
Xor
Eqv
10
Input/Output Operations
6.1 InputBox Function
Displays a prompt in a dialog box, waits for the user to input text or click a button, and
returns the contents of the text box.
Example:
Dim Input
Input = InputBox("Enter your name")
MsgBox ("You entered: " & Input)
6.2 MsgBox Function
Displays a message in a dialog box, waits for the user to click a button, and returns a value
indicating which button the user clicked.
Example:
Dim MyVar
MyVar = MsgBox ("Hello World!", 65, "MsgBox Example")
' MyVar contains either 1 or 2, depending on which button is clicked.
www.gcreddy.com
11
www.gcreddy.com
12
1) IfThenElse Statement
2) Select Case Statement
8.1 Making Decisions Using If...Then...Else
The If...Then...Else statement is used to evaluate whether a condition is True or False and,
depending on the result, to specify one or more statements to run.
Usually the condition is an expression that uses a comparison operator to compare one
value or variable with another.
If...Then...Else statements can be nested to as many levels as you need.
8.1.1 Running a Statement if a Condition is True (single statement)
To run only one statement when a condition is True, use the single-line syntax for the
If...Then...Else statement.
Dim myDate
myDate = #2/13/98#
If myDate < Now Then myDate = Now
8.1.2 Running Statements if a Condition is True (multiple statements)
To run more than one line of code, we must use the multiple-line (or block) syntax. This
syntax includes the End If statement.
Dim x
x= 20
If x>10 Then
msgbox "Hello G.C.Reddy"
msgbox "x value is: "&x
msgbox "Bye Bye"
End If
8.1.3 Running Certain Statements if a Condition is True and Running Others if a
Condition is False
We can use an If...Then...Else statement to define two blocks of executable statements: one
block to run if the condition is True, the other block to run if the condition is False.
Example:
Dim x
x= Inputbox (" Enter a value")
www.gcreddy.com
13
8.1.5 Executing a certain block of statements when two / more conditions are
True (Nested If...)
Example:
Dim State, Region
State=Inputbox ("Enter a State")
Region=Inputbox ("Enter a Region")
If state= "AP" Then
If Region= "Telangana" Then
msgbox "Hello G.C.Reddy"
msgbox "Dist count is 10"
www.gcreddy.com
14
If
If
If
If
Result= x-y
Msgbox "Hello G.C.Reddy"
Msgbox "Substraction of x,y values is "&Result
Case "mul"
Result= x*y
Msgbox "Hello G.C.Reddy"
Msgbox "Multiplication of x,y values is "&Result
Case "div"
Result= x/y
Msgbox "Hello G.C.Reddy"
Msgbox "Division of x,y values is "&Result
Case "mod"
Result= x mod y
www.gcreddy.com
15
End Select
www.gcreddy.com
16
End If
www.gcreddy.com
17
If
If
If
If
www.gcreddy.com
18
www.gcreddy.com
19
(1))
(1))
(1))
(1))
(1))
(1))
(1))
(1))
If isnumeric (d1) = "True" and isnumeric (d2) = "True" and isnumeric (d3) = "True" and
isnumeric (d4) = "True"and isnumeric (d5) = "True"and isnumeric (d6) = "True"and
isnumeric (d7) = "True"and isnumeric (d8) = "True"and isnumeric (d9) = "True"and
isnumeric (d10) = "True" Then
msgbox "It is a Numeric Value"
else
Msgbox "It is NOT Numeric"
End If
8.17 Verify weather the entered value is a 10 digit value or not and Numeric value
or not? (Using multiple if conditions)
Dim a,x,y,z,num
num=Inputbox ("Enter a Phone Number")
d1= left (num,1)
d10=Right (num,1)
d2=mid (num, 2, len (1))
www.gcreddy.com
20
(num,
(num,
(num,
(num,
(num,
(num,
(num,
3,
4,
5,
6,
7,
8,
9,
len
len
len
len
len
len
len
(1))
(1))
(1))
(1))
(1))
(1))
(1))
www.gcreddy.com
21
There are also loops that repeat statements a specific number of times.
For Each...Next: Repeats a group of statements for each item in a collection or each
element of an array.
www.gcreddy.com
22
www.gcreddy.com
23
www.gcreddy.com
24
www.gcreddy.com
25
www.gcreddy.com
26
Arguments serve as placeholders for the data we want to pass into our procedure.
We can name our arguments any valid variable name.
When we create a procedure using either the Sub statement or the Function
statement, parentheses must be included after the name of the procedure.
www.gcreddy.com
27
www.gcreddy.com
28
Conversions (25)
Dates/Times (19)
Input/Output (3)
Math (9)
Miscellaneous (3)
Rounding (5)
Strings (30)
Variants (8)
Important Functions
1) Abs Function
Returns the absolute value of a number.
Dim num
num=abs(-50.33)
msgbox num
2) Array Function
Returns a variant containing an Array
Dim A
A=Array("hyderabad","chennai","mumbai")
msgbox A(0)
ReDim A(5)
A(4)="nellore"
msgbox A(4)
3) Asc Function
Returns the ANSI character code corresponding to the first letter in a string.
Dim num
num=Asc("A")
msgbox num
* It returns the value 65 *
4) Chr Function
Returns the character associated with the specified ANSI character code.
Dim char
Char=Chr(65)
msgbox char
www.gcreddy.com
29
Dim myday
myday=Day("17,December,2009")
msgbox myday
Ex2)
Dim myday
mydate=date
myday=Day(Mydate)
msgbox myday
8) DateDiff Function
Returns the number of intervals between two dates.
Dim myday
mydate=#02-17-2009#
x=Datediff("d",mydate,Now)
msgbox x
9) Hour Function
Returns a whole number between 0 and 23, inclusive, representing the hour of the day.
Dim mytime, Myhour
mytime=Now
myhour=hour (mytime)
msgbox myhour
10) Join Function
Returns a string created by joining a number of substrings contained in an array.
Dim mystring, myarray(3)
myarray(0)="Chandra "
myarray(1)="Mohan "
myarray(2)="Reddy"
mystring=Join(MyArray)
msgbox mystring
www.gcreddy.com
30
' Returns 2.
MyCheck = VarType(#10/19/62#)
Msgbox Mycheck
MyCheck = VarType("VBScript")
Msgbox Mycheck
' Returns 7.
' Returns 8.
www.gcreddy.com
31
www.gcreddy.com
32
www.gcreddy.com
33
21.7 Spaces:
We can add extra blank spaces to our script to improve clarity. These spaces are ignored by
VBScript.
Errors
We have two types Errors in VB Script; they are VBScript Run-time Errors and VBScript
Syntax Errors
13.1 VBScript Run-time Errors
VBScript run-time errors are errors that result when our VBScript script attempts to perform
an action that the system cannot execute. VBScript run-time errors occur while our script is
being executed; when variable expressions are being evaluated, and memory is being
dynamic allocated.
13.2 VBScript Syntax Errors
VBScript syntax errors are errors that result when the structure of one of our VBScript
statements violates one or more of the grammatical rules of the VBScript scripting
language. VBScript syntax errors occur during the program compilation stage, before the
program has begun to be executed.
www.gcreddy.com
34
www.gcreddy.com
35
www.gcreddy.com
36
www.gcreddy.com
37
www.gcreddy.com
38
www.gcreddy.com
39
Test Requirements
1) Verify Login Boundary (Check all the boundary conditions of the Login window.
Checks to see if the correct message appears in the error window (Flight Reservation
Message)
2) Verify Cancel Operation (in Login Dialog box, if user selects cancel button, before
enter any data after enter data dialog box should be disappeared.)
3) Verify Addition, Subtraction, Multiplication and Division Operations in
Calculator Application.
4) Verify state of Update Order Button, before open an Order and after open an
Order (in Flight Reservation before opening an order Update Order button should be
disabled after opening an order enabled.)
5) Price Consistency, In Flight Reservation (In Flight Reservation, First class
price=3*Economy class price and Business class price=2*Economy class price)
6) Verify Total, In Flight Reservation (In Flight Reservation, Total = Tickets * Price)
www.gcreddy.com
40
12)
Count how many Buttons and Edit boxes available in Flight
Reservation window?
13) Verify search options in Open Order Dialog box
(After selecting open order, 3 search options should be enabled and not checked,
After selecting Order No option, other options should be disabled,
After selecting Customer Name, Flight date option enabled and Order No disabled
After selecting Flight date option, Customer Name enabled and Order No disabled)
14) In Login Dialog box, Verify Help message (The message is The password is
'MERCURY')
15) Count all opened Browsers on desktop and close all?
16) Create an Excel file, enter some data and save the file through VB scripting?
Solutions:
1) Verify Login Boundary (Check all the boundary conditions of the Login dialog box.
Checks to see if the correct message appears in the error window (Flight Reservation
Message)
1) ApplicationDir = Environment("ProductDir")
2) ApplicationPath = "\samples\flight\app\flight4a.exe"
3) If Window("Flight Reservation").Exist(2) Then
www.gcreddy.com
41
www.gcreddy.com
42
www.gcreddy.com
43
www.gcreddy.com
44
www.gcreddy.com
45
www.gcreddy.com
46
www.gcreddy.com
47
www.gcreddy.com
48
www.gcreddy.com
49
www.gcreddy.com
50
www.gcreddy.com
51
www.gcreddy.com
52
www.gcreddy.com
53
www.gcreddy.com
54
Description
An ActiveX control.
An ActiveX button.
An ActiveX calendar object.
An ActiveX check box.
An ActiveX combo box object.
An ActiveX edit box.
An ActiveX radio button.
An ActiveX table.
An object that enables you to work with objects
returned by performing an operation (usually via the
Object property) on an ActiveX test object.
Description
A Delphi button.
A Delphi check box.
www.gcreddy.com
55
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
Delphi
Delphi
Delphi
Delphi
Delphi
Delphi
Delphi
Delphi
Delphi
Delphi
Delphi
Delphi
Delphi
Delphi
Delphi
Delphi
combo box.
edit box.
multi-line editor.
list.
list-view control.
navigator control.
object.
radio button.
scroll bar.
spin box.
static control.
status bar.
table.
tab strip.
tree-view control.
window or dialog box.
Description
A Java applet.
A Java button.
A Java calendar.
A Java check box.
A Java dialog box.
A Java edit box.
A Java control that contains labeled
bar items, which can be expanded or
collapsed by the user.
An internal frame that can be activated
from the Java applet.
A Java control that displays text with
links.
A Java list box with single or multiple
selection.
A Java menu item.
A generic Java object.
A Java radio button.
A Java slider.
A Java spin object.
www.gcreddy.com
56
JavaTab
JavaTable
JavaToolbar
JavaTree
JavaWindow
IV) .NET Web Forms Environment
Object
WbfCalendar
WbfGrid
WbfTabStrip
WbfToolbar
WbfTreeView
WbfUltraGrid
A
A
A
A
A
A
.NET
.NET
.NET
.NET
.NET
.NET
Description
Web Forms calendar control.
Web Forms DataGrid object.
Web Forms tabstrip control.
Web Forms toolbar control.
Web Forms tree view object.
Web Forms UltraGrid object.
Description
A .NET Windows Forms button object.
A DateTimePicker or a Month Calendar .NET Windows
Forms calendar object.
A .NET Windows Forms check box.
A .NET Windows Forms combo box.
A .NET Windows Forms edit box.
A .NET Windows Forms multi-line edit box.
A .NET Windows Forms static text object.
A .NET Windows Forms list.
A .NET Windows Forms ListView control.
A standard .NET Windows Forms object.
A property grid control based on the .NET Windows
Forms library.
A .NET Windows Forms radio button.
A .NET Windows Forms scroll bar.
A .NET Windows Forms spin object.
A .NET Windows Forms status bar control.
A .NET Windows Forms tab control.
A grid control based on the .NET Windows Forms
www.gcreddy.com
57
SwfToolBar
SwfTreeView
SwfWindow
library.
A .NET Windows Forms toolbar.
A .NET Windows Forms TreeView control.
A .NET Windows Forms window.
Description
A button control in a Windows Presentation
Foundation application.
A check box control in a Windows Presentation
Foundation application.
A combo box control in a Windows Presentation
Foundation application.
A document, rich text box, or text control in a
Windows Presentation Foundation application.
A grid control in a Windows Presentation Foundation
application.
An image control in a Windows Presentation
Foundation application.
A hyperlink control in a Windows Presentation
Foundation application.
A list control in a Windows Presentation Foundation
application.
A menu control in a Windows Presentation Foundation
application.
An object control in a Windows Presentation
Foundation application.
A progress bar control in a Windows Presentation
Foundation application.
A radio button control in a Windows Presentation
Foundation application.
A scroll bar control in a Windows Presentation
Foundation application.
A slider control in a Windows Presentation Foundation
application.
A status bar control in a Windows Presentation
Foundation application.
A tab control in a Windows Presentation Foundation
application.
www.gcreddy.com
58
WpfToolbar
WpfTreeView
WpfWindow
Description
An Oracle Applications session window.
An Oracle button.
An Oracle calendar.
A check box Oracle field.
An Oracle flexfield window.
An Oracle Form window.
An Oracle poplist (combo box) or list.
An Oracle window containing a list of values for
selection.
An Oracle Applications sign-on window.
An Oracle Navigator window.
An Oracle error or message window.
An Oracle option (radio button) group.
The status line and message line at the bottom of an
Oracle Applications window.
An Oracle tabbed region.
An Oracle block of records.
An Oracle text field.
An Oracle tree.
Description
A frame object within a PeopleSoft application.
Description
A PowerBuilder button.
www.gcreddy.com
59
A
A
A
A
A
A
A
A
A
A
A
A
Description
An SAP Gui for HTML application button, including
icons, toolbar buttons, regular buttons, buttons with
text, and buttons with text and image.
A calendar in a Web-based SAP application.
An SAP Gui for HTML application toggle button,
including check boxes and toggle images.
A menu that is opened by clicking a menu icon within
an SAP Gui for HTML application.
An SAP Gui for HTML application edit box, including
single-line edit boxes and multi-line edit boxes (text
area).
An SAP Gui for HTML application frame.
An SAP Enterprise Portal application iView frame.
A drop-down or single/multiple selection list in an SAP
Gui for HTML application.
An SAP Gui for HTML application top-level menu.
A navigation bar in a Web-based SAP application.
An OK Code box in an SAP Gui for HTML application.
An SAP Enterprise Portal desktop.
An SAP Gui for HTML application radio button group.
An SAP Gui for HTML application status bar.
An SAP Gui for HTML application table or grid.
An SAP Gui for HTML application tab strip object (an
object that enables switching between multiple tabs).
www.gcreddy.com
60
Description
An APO grid control in an SAP GUI for Windows
application.
A button in an SAP GUI for Windows application.
A calendar object in an SAP GUI for Windows
application.
A check box in an SAP GUI for Windows application.
A combo box in an SAP GUI for Windows application.
An edit box in an SAP GUI for Windows application.
Any object in an SAP GUI for Windows application.
A grid control in an SAP GUI for Windows application.
A static text label in an SAP GUI for Windows
application.
A menu bar in an SAP GUI for Windows application.
An OK Code box in an SAP GUI for Windows
application.
A radio button in an SAP GUI for Windows application.
Represents the SAP GUI for Windows session on
which an operation is performed.
A status bar in an SAP GUI for Windows application.
A table control in an SAP GUI for Windows
application.
A tab strip in an SAP GUI for Windows application.
A text area in an SAP GUI for Windows application.
A toolbar in an SAP GUI for Windows application.
A column tree, list tree, or simple tree control in an
SAP GUI for Windows application.
A utility object in an SAP GUI for Windows
application.
A window or dialog box containing objects in an SAP
GUI for Windows application.
Description
An edit box whose value can be set by a
dynamic object that opens after clicking on a
www.gcreddy.com
61
62
SiebTaskAssistant
SiebTaskUIPane
SiebText
SiebTextArea
SiebThreadbar
SiebToolbar
SiebTree
SiebView
SiebViewApplets
environment.
The Task Assistant in a Siebel test automation
environment.
The task UI pane in a Siebel test automation
environment.
A text box in a Siebel test automation
environment.
A text area in a Siebel test automation
environment.
A threadbar in a Siebel test automation
environment.
A toolbar in a Siebel test automation
environment.
A tree view object in a Siebel test automation
environment.
A view object in a Siebel test automation
environment.
A view applet in a Siebel test automation
environment.
Description
An object that enables you to access top-level items
on your desktop.
A Windows dialog box.
A static text object.
An object used to control applications and processes
during a run session.
A Windows button.
A Windows calendar.
A Windows check box.
A Windows combo box.
A standard window.
A Windows edit box.
A Windows multi-line editor.
A Windows list.
A Windows list-view control.
www.gcreddy.com
63
A
A
A
A
A
A
A
A
A
Windows
standard
Windows
Windows
Windows
Windows
Windows
Windows
Windows
menu.
(Windows) object.
radio button.
scroll bar.
spin box.
status bar.
tab strip in a dialog box.
toolbar.
tree-view control.
A
A
A
A
Description
Windows tab strip in a dialog box.
Stingray grid.
Windows toolbar.
Stingray tree control.
Description
A terminal emulator field that fully supports HLLAPI.
A terminal emulator screen that fully supports
HLLAPI.
A terminal emulator screen that uses text-only
HLLAPI or does not support HLLAPI.
A terminal emulator window.
TeField
TeScreen
TeTextScreen
TeWindow
A
A
A
A
A
A
A
A
A
Description
Visual Basic button.
Visual Basic check box.
Visual Basic combo box.
Visual Basic edit box.
Visual Basic multi-line editor.
Visual Basic frame.
static text object.
Visual Basic list.
Visual Basic list-view control.
www.gcreddy.com
64
A
A
A
A
A
Visual
Visual
Visual
Visual
Visual
Basic
Basic
Basic
Basic
Basic
radio button.
scroll bar.
toolbar.
tree-view control.
window.
Description
A button in the VisualAge Smalltalk application.
An edit box in the VisualAge Smalltalk application.
A list in the VisualAge Smalltalk application.
An object in the VisualAge Smalltalk application.
A tab strip in the VisualAge Smalltalk application.
A table in the VisualAge Smalltalk application.
A tree-view control in the VisualAge Smalltalk
application.
Description
A Web browser (or browser tab).
An HTML frame.
An image with or without a target URL link.
A hypertext link.
An HTML page.
A Viewlink object.
A section of an image (usually a section of a clientside image map).
An HTML button.
A check box with an ON and OFF state.
An edit box, usually contained inside a form.
A general Web object that can represent any Web
object.
An edit box with a browse button attached, used to
select a file from the File dialog box.
A drop-down box or multiple selection list.
A set of radio buttons belonging to the same group.
A table containing a variable number of rows and
columns.
www.gcreddy.com
65
Description
An object that supports attachment-related test
object operations.
An object that supports configuration-related test
object operations.
An object that supports header-related test object
operations.
An object that supports security-related test object
operations.
A test object representing a Web service.
A utility object used to check WSDL files.
B) Utility Objects
Crypt Object
DataTable Object
Description Object
DotNetFactory Object
DTParameter Object
DTSheet Object
Environment Object
Extern Object
LocalParameter Object
MercuryTimer Object
Parameter Object
PathFinder Object
QCUtil Object
RandomNumber Object
Recovery Object
www.gcreddy.com
66
Reporter Object
RepositoriesCollection Object
Repository Object
Services Object
Setting Object
SystemMonitor Object
TextUtil Object
TSLTest Object
XMLUtil Object
DescribeResult Statement
ExecuteFile Statement
ExitAction Statement
ExitActionIteration Statement
ExitComponent Statement
ExitComponentIteration Statement
ExitTest Statement
ExitTestIteration Statement
GetLastError Statement
InvokeApplication Statement
LoadAndRunAction Statement
ManualStep Statement
Print Statement
RegisterUserFunc Statement
RunAction Statement
SetLastError Statement
UnregisterUserFunc Statement
Wait Statement
www.gcreddy.com
67
C) Supplemental Objects
DbTable Object
VirtualButton Object
VirtualCheckBox Object
VirtualList Object
VirtualObject Object
VirtualRadioButton Object
VirtualTable Object
XMLAttribute Object
XMLAttributesColl Object
XMLData Object
XMLElement Object
XMLElementsColl Object
XMLFile Object
XMLItemColl Object
VBScript Glossary
ActiveX control
An object that you place on a form to enable or enhance a user's interaction with an
application. ActiveX controls have events and can be incorporated into other controls.
The controls have an .ocx file name extension.
ActiveX object
An object that is exposed to other applications or programming tools through
Automation interfaces.
www.gcreddy.com
68
Argument
A constant, variable, or expression passed to a procedure.
Array
A set of sequentially indexed elements having the same type of data. Each element
of an array has a unique identifying index number. Changes made to one element of
an array do not affect the other elements.
ASCII Character Set
American Standard Code for Information Interchange (ASCII) 7-bit character set
widely used to represent letters and symbols found on a standard U.S. keyboard. The
ASCII character set is the same as the first 128 characters (0127) in the ANSI
character set.
Automation object
An object that is exposed to other applications or programming tools through
Automation interfaces.
Bitwise comparison
A bit-by-bit comparison of identically positioned bits in two numeric expressions.
Boolean expression
An expression that evaluates to either True or False.
By reference
A way of passing the address, rather than the value, of an argument to a procedure.
This allows the procedure to access the actual variable. As a result, the variable's
actual value can be changed by the procedure to which it is passed.
By value
A way of passing the value, rather than the address, of an argument to a procedure.
This allows the procedure to access a copy of the variable. As a result, the variable's
actual value can't be changed by the procedure to which it is passed.
character code
A number that represents a particular character in a set, such as the ASCII character
set.
Class
www.gcreddy.com
69
Constant
A named item that retains a constant value throughout the execution of a program.
Constants can be used anywhere in your code in place of actual values. A constant
can be a string or numeric literal, another constant, or any combination that includes
arithmetic or logical operators except Is and exponentiation. For example:
Const A = "MyString"
Data ranges
Each Variant subtype has a specific range of allowed values:
Subtype
Range
Byte
0 to 255.
Boolean
True or False.
Integer
-32,768 to 32,767.
Long
-2,147,483,648 to 2,147,483,647.
www.gcreddy.com
70
Double
Object
String
Date expression
Any expression that can be interpreted as a date. This includes any combination of
date literals, numbers that look like dates, strings that look like dates, and dates
returned from functions. A date expression is limited to numbers or strings, in any
combination, that can represent a date from January 1, 100 through December 31,
9999.
Dates are stored as part of a real number. Values to the left of the decimal represent
the date; values to the right of the decimal represent the time. Negative numbers
represent dates prior to December 30, 1899.
Date literal
Any sequence of characters with a valid format that is surrounded by number signs
(#). Valid formats include the date format specified by the locale settings for your
code or the universal date format. For example, #12/31/99# is the date literal that
represents December 31, 1999, where English-U.S. is the locale setting for your
application.
In VBScript, the only recognized format is US-ENGLISH, regardless of the actual
locale of the user. That is, the interpreted format is mm/dd/yyyy.
Date separators
Characters used to separate the day, month, and year when date values are
formatted.
Empty
A value that indicates that no beginning value has been assigned to a variable.
Empty variables are 0 in a numeric context, or zero-length in a string context.
www.gcreddy.com
71
Error number
A whole number in the range 0 to 65,535, inclusive, that corresponds to the
Number property of the Err object. When combined with the Name property of the
Err object, this number represents a particular error message.
Expression
A combination of keywords, operators, variables, and constants that yield a string,
number, or object. An expression can perform a calculation, manipulate characters,
or test data.
Intrinsic constant
A constant provided by an application. Because you can't disable intrinsic constants,
you can't create a user-defined constant with the same name.
Keyword
A word or symbol recognized as part of the VBScript language; for example, a
statement, function name, or operator.
Locale
The set of information that corresponds to a given language and country. A locale
affects the language of predefined programming terms and locale-specific settings.
There are two contexts where locale information is important:
The code locale affects the language of terms such as keywords and defines
locale-specific settings such as the decimal and list separators, date formats,
and character sorting order.
The system locale affects the way locale-aware functionality behaves, for
example, when you display numbers or convert strings to dates. You set the
system locale using the Control Panel utilities provided by the operating
system.
Nothing
The special value that indicates that an object variable is no longer associated with
any actual object.
Null
A value indicating that a variable contains no valid data. Null is the result of:
An explicit assignment of Null to a variable.
Any operation between expressions that contain Null.
Numeric expression
Any expression that can be evaluated as a number. Elements of the expression can
include any combination of keywords, variables, constants, and operators that result
in a number.
www.gcreddy.com
72
Object type
A type of object exposed by an application, for example, Application, File, Range, and
Sheet. Refer to the application's documentation (Microsoft Excel, Microsoft Project,
Microsoft Word, and so on) for a complete listing of available objects.
pi
Private
Variables that are visible only to the script in which they are declared.
Procedure
A named sequence of statements executed as a unit. For example, Function and
Sub are types of procedures.
Procedure level
Describes statements located within a Function or Sub procedure. Declarations are
usually listed first, followed by assignments and other executable code. For example:
Sub MySub() ' This statement declares a sub procedure block.
Dim A ' This statement starts the procedure block.
A = "My variable" ' Procedure-level code.
Debug.Print A ' Procedure-level code.
End Sub ' This statement ends a sub procedure block.
Note that script-level code resides outside any procedure blocks.
Property
A named attribute of an object. Properties define object characteristics such as size,
color, and screen location, or the state of an object, such as enabled or disabled.
Public
Variables declared using the Public Statement are visible to all procedures in all
modules in all applications.
Run time
The time when code is running. During run time, you can't edit the code.
Run-time error
www.gcreddy.com
73
SCODE
A long integer value that is used to pass detailed information to the caller of an
interface member or API function. The status codes for OLE interfaces and APIs are
defined in FACILITY_ITF.
Script level
Any code outside a procedure is referred to as script-level code.
Seed
String comparison
A comparison of two sequences of characters. Unless specified in the function making
the comparison, all string comparisons are binary. In English, binary comparisons are
case-sensitive; text comparisons are not.
String expression
Any expression that evaluates to a sequence of contiguous characters. Elements of a
string expression can include a function that returns a string, a string literal, a string
constant, or a string variable.
Type library
A file or component within another file that contains standard descriptions of exposed
objects, properties, and methods.
Variable
A named storage location that can contain data that can be modified during program
execution. Each variable has a name that uniquely identifies it within its level of
scope.
Variable names:
www.gcreddy.com
74
www.gcreddy.com
75