Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
401Activity
0 of .
Results for:
No results containing your search query
P. 1
VBScript in QTP

VBScript in QTP

Ratings:

4.85

(20)
|Views: 38,513 |Likes:
Published by sachxn
VBScript in QTP (QuickTest Professional)
VBScript in QTP (QuickTest Professional)

More info:

Published by: sachxn on Oct 20, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

05/14/2013

pdf

text

original

 
For QTP Tutorials & Interview Questions, go to http://qtp.blogspot.com  For QTP Tutorials & Interview Questions, go to http://qtp.blogspot.com 
1
 VBScript in QTP
Table of Contents
VBScript in QTP……………………………………………………………………………… 2VBScript Variable…………………………………………………………………………… 3VBScript Arrays ………………………………………………………………………………5VBScript Functions and Subroutines…………………………………………….. 8VBScript Conditional Statements…………………………………………………..11VBScript Looping Statements………………………………………………………. 15VBScript Classes …………………………………………………………………………….20VBScript- Property Let, Property Get, Property Set…………………….. 25Example of VBScript - Property Let, Property Get, Property Set… 30
 
For QTP Tutorials & Interview Questions, go to http://qtp.blogspot.com  For QTP Tutorials & Interview Questions, go to http://qtp.blogspot.com 
2
VBScript in QTP
Scripting language for QuickTest Professional (QTP) is VBScript.VBScript (short for Visual Basic Scripting Edition) is a lively scripting languageinterpreted via Microsoft's Windows Script Host.VBScript has many
 powerful functions
and provides excellent support for variables,data types, and error handling.Two script engines can interpret VBScript-
VBScript.dll
, which is invoked by asp.dllis used in web environment and
Wscript.exe
Cscript.exe
in WindowsGUI environment using Windows script Host (WSH, We typically use VBScript withinWSH to automate systems administration tasks. WSH is the system module thattransforms a VBScript file into a Windows executable file).Wscript.exe is used to display output and receive input in Windows GUI format suchas dialog and input boxes. Cscript.exe is used in a command-line environment. WhenVBScript source code is contained in stand-alone files, they have the file extension.vbs.
 
For QTP Tutorials & Interview Questions, go to http://qtp.blogspot.com  For QTP Tutorials & Interview Questions, go to http://qtp.blogspot.com 
3
VBScript Variable
In VBScript all variables are of the type
variant
that can store any type of value.The name of a variable in VBScript must begin with a letter and it cannot containperiod (.) and its maximum length can be of 255 characters.It must be distinctive (unique) within the scope in which it is declared. If we declarea variable inside a procedure then its scope is local to that procedure and only codewithin that procedure can access it, but if we declare a variable outside a procedurein a script, it is available to all the procedures in a script. Procedure level variableexits as long as we are in the procedure and a life of a script level variable is thetime it is declare up till the time script finishes.Variables can be declared
explicitly
and
implicitly
.Explicitly variables are declared with Dim statement, Public Statement, PrivateStatement.Dim NameDim Name, employee_address, cityImplicitly we can declare them within the script by just using the variable name.But this practice is prone to errors.We can compel VBScript to require all variables to be explicitly declared by includingthe statement
Option Explicit 
at the start of every script.VBScript does not provide support for
constants
.From VBScript 5.0 onwards programmers are able to create class constructs inVBScript-A step towards OOP.Variables declared by Dim and Public are public in nature (accessible outside of theclass). By default also variables are Public in nature. With Private we can declarevariables not visible outside of the class.Example of a variable:Enter this in notepad, save the notepad with some name and .html extension (likeI saved it in c:\pro\a.html where pro is a name of a folder)

Activity (401)

You've already reviewed this. Edit your review.
Shalini Vyshaka liked this
gchandna liked this
Shantala Meti liked this
Tester VietNam liked this
aslam_zeeja2007 liked this
Miki Eden liked this
Raj Sharma liked this
AmritUpadhyay added this note
Sir if i upload my personel Notes and if it is liked then can i get payement on Bekalf of it

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->