Vb-Script 1
Vb-Script 1
Search
Automating Word
Documents Part-3
Automating MS Word
Documents – Part 2
Automating Word Subscribe to QTP
Documents: Part 1
Blog
Happy Diwali
QTP Training On-
Demand is Now Enter your email address
Available
Subscribe
http://mercuryquicktestprofessional.blogspot.com/2007/10/vb-script-and-qtp-part1.html 1/4/2011
VB Script and QTP - Part1 | Quick Test Professional(QTP) Page 2 of 15
Regular Expression
Regularized!!! You can also declare a variable implicitly by simply using its name
How to count total no of in your script. That is not generally a good practice because you
rows when all are not could misspell the variable name in one or more places, causing
visible? unexpected results when your script is run. For that reason, the
Integrating ECATT and Option Explicit statement is available to require explicit declaration of all
QTP variables. The Option Explicit statement should be the first statement in
Sending SOAP XML your script.
message using QTP Note:
Variables declared with Dim at the script level are available to all
Use keyboard to send
input to your application procedures within the script. At the procedure level, variables are available
only within the procedure.
Limitations of DataTable
Public statement variables are available to all procedures in all scripts.
Recovery Scenarios in Private statement variables are available only to the script in which they
QTP are declared.
Naming Convention
About Me
There are standard rules for naming variables in VBScript. A variable
View my name:
complete
1. · Must begin with an alphabetic character.
profile 2. · Cannot contain an embedded period.
3. · Must not exceed 255 characters.
4. · Must be unique in the scope in which it is declared.
A constant is a meaningful name that takes the place of a number or a QTP certification details
Visual C++ Run time
string, and never changes. VBScript in itself has a number of defined Training and Certification
library error
intrinsic constants like vbOK, vbCancel, vbTrue, vbFalse and so on.
You create user-defined constants in VBScript using the Const statement.
General Run Error
Using the Const statement, you can create string or numeric constants Translate
with meaningful names and assign them literal values. For example: Select Language
Const MyString = "This is my string."Const MyAge = 49 Gadgets powered by
Test Yourself on QTP Google
Note that the string literal is enclosed in quotation marks (" "). Also note
QTP Quiz: Objective Q & that constants are public by default. Automation Object
A Within procedures, constants are always private; their visibility can't be Model
changed.
Technical Interview Next post we will deal with constructs and arrays. Basics of AOM
Questions on QTP
Run QTP Scripts at
If you want to keep track of further articles on QTP. I recommend you to Scheduled Time
subscribe via RSS Feed. You can also subscribe by Email and have new QTP
Check already running
articles sent directly to your inbox. process
Posted by Ankur
http://mercuryquicktestprofessional.blogspot.com/2007/10/vb-script-and-qtp-part1.html 1/4/2011
VB Script and QTP - Part1 | Quick Test Professional(QTP) Page 3 of 15
shilpi said...
Hi Ankur,
Ankur i want to know that wats the best way to write an
automation script in QTP. Actually i am a beginner so am
totaly scared about to write a script. So please help me
out..
ponraj said...
hi nikhila,
smiles said...
Anonymous said...
HI
can u tell me
thank you
Anonymous said...
HI
thank you
abdal said...
http://mercuryquicktestprofessional.blogspot.com/2007/10/vb-script-and-qtp-part1.html 1/4/2011
VB Script and QTP - Part1 | Quick Test Professional(QTP) Page 4 of 15
Dear Ankur,
Search
I have gone through the VBScript material you have
provided in this site. It is very clear and easy to catch all
those defined. I want to write and execute some scripts on ABOUT | CONSULTING/ADVERTISING | QTP JOBS | QTP TRAINING | PRIVACY
my own. Is there any VBScript editor available for free. If POLICY
it is, please tell me the link from where I can get. Or
(© 2006- 2010) ANKUR JAIN. THE CONTENT IS COPYRIGHTED TO ANKUR JAIN
otherwise please tell the tool to write and execute AND SHOULD NOT BE REPRODUCED ON OTHER WEBSITES.
VBscipts. But I don't want to test through notepad and IE.
Ankur said...
@ Anon:
You can refer my posts on Differences in QTP versions and
about frameworks
Refer
http://www.geekinterview.com/question_details/17367 for
difference between TD and QC
@ Abdal:
You can use QTP Expert View to practice on VB Script.
tc said...
Kumari said...
Hi Ankur,
Best Regards,
Vandy.
srinivas said...
Hi Ankur
neeharika said...
Kiran said...
http://mercuryquicktestprofessional.blogspot.com/2007/10/vb-script-and-qtp-part1.html 1/4/2011
VB Script and QTP - Part1 | Quick Test Professional(QTP) Page 5 of 15
laxminarayan said...
Anonymous said...
hi this is vish
my request is to send a complete flow of vb script for any
web appl.
for one flow or scenario.
thanking u.
Anonymous said...
hi this is vish
my request is to send a complete flow of vb script for any
web appl.
for one flow or scenario.
thanking u.
snig said...
good post
Anonymous said...
Anonymous said...
Thanks Ankur...
Anonymous said...
Raj said...
hi this is raj,
with thanks
http://mercuryquicktestprofessional.blogspot.com/2007/10/vb-script-and-qtp-part1.html 1/4/2011
VB Script and QTP - Part1 | Quick Test Professional(QTP) Page 6 of 15
Khalida said...
Khalida said...
Hi Ankur,
Thanks a lot...
Anonymous said...
Hi Ankur,
Appreciate your help for creating this blogger.I'm using
QTP 9.2.If I need to run the tests by writing the
scripts,whats the command for calling object repository.
(as this will help the application in identifying the objects
during testing)In 8.0 we used the following syntax
App.test.settings.resources.objectrepositorypath =
"D:\bank_new\bank_obj_repo\bank.tsr"
amit said...
PANDA said...
Hi there,
This is Pranav DAve I m new to QTP and i wann know how
to use VB script in QTP pls jsuggest me any link where i
can find any of the samples.
My Email ID is
[email protected]
Anonymous said...
Hi Guys,
http://mercuryquicktestprofessional.blogspot.com/2007/10/vb-script-and-qtp-part1.html 1/4/2011
VB Script and QTP - Part1 | Quick Test Professional(QTP) Page 7 of 15
Best of luck.
Karan
[email protected]
sonika said...
Hi Ankur,
srinivas said...
Nikhila said...
Ankur
Thanks
Sriniv
dhruv said...
Hi Ankur,
thanks
dhruv
nimi said...
http://mercuryquicktestprofessional.blogspot.com/2007/10/vb-script-and-qtp-part1.html 1/4/2011
VB Script and QTP - Part1 | Quick Test Professional(QTP) Page 8 of 15
Ankur said...
Anonymous said...
Nikhila/Srinivas
Please mail me the details that you had asked for to my id
[email protected]
Me too interested to know.
Thanks
Anonymous said...
balur said...
Hi Ankur,
I am in a big problem i.e my system is restarting when i
start to record any application.
My system is working for QTP8.2 but when installing
9.1,9.2 or 9.5 it is the problem.
To out of this i have formated the system once even
though it is restarting again.
Plz send some solution to over come this to me on
[email protected]
PLzzzzzzzzzzzzzzzzzzzzzzzzzz
Anonymous said...
Hi there,
This is Ashish. I m new to QTP and i wanna know how to
use VB script in QTP pls suggest me any link where i can
find any of the samples.
My Email ID is
[email protected]
Hello ...
http://www.w3schools.com/Vbscript/vbscript_examples.as
p
Vandana`
Anonymous said...
http://mercuryquicktestprofessional.blogspot.com/2007/10/vb-script-and-qtp-part1.html 1/4/2011
VB Script and QTP - Part1 | Quick Test Professional(QTP) Page 9 of 15
Hai
QTP Code
----------------------
Dim MyArray(2)
MyArray(0) = "Sunday"
MyArray(1) = "Monday"
MyArray(2) = "Tuesday"
Call callweekdays()
Function Code(QFL)
----------------
(Added to Test Resources)
End Function
Thanks
Adithya Kumar
Anonymous said...
Hi Adithya Kumar,
Thanks
Bharathi
Anonymous said...
hi Ankur,
This is a great post,
e.g.,
subscriptval = 3
dim MyArray1(subscriptval)
thanks in advance,
Prashant
Anonymous said...
@[email protected]:
hi pass the array to your function available in the function
http://mercuryquicktestprofessional.blogspot.com/2007/10/vb-script-and-qtp-part1.html 1/4/2011
VB Script and QTP - Part1 | Quick Test Professional(QTP) Page 10 of 15
Dim myarray(2)
myarray(0) = "sunday"
myarray(1) = "monday"
myarray(2) = "tuesday"
Call xzy(myarray)
Lopamudra said...
Hi Ankur,
Shreyansh said...
hi,
i know the qtp but i never use it in any live project ..so pls
help me to use the QTP in live projects.If u have any links
regarding live project with QTp pls provide me..this is my
mail id [email protected]
umangi said...
Hi ankur,
Ankur said...
Anonymous said...
Anonymous said...
Hi Ankur,
In a recent interview i was asked a question to write a
VBScript for this
I wrote the code using select case, i'm not sure is i was
correct.
Could you please tell how to put this VBScript
http://mercuryquicktestprofessional.blogspot.com/2007/10/vb-script-and-qtp-part1.html 1/4/2011
VB Script and QTP - Part1 | Quick Test Professional(QTP) Page 11 of 15
renuka said...
Hi Ankur,
Anonymous said...
Hi Ankur ,
I was into Manual testing all these days , But Now My
Company has permited me to use Automation tool, Can
we test D2K Applications Using QTP, If Yes, Can I know
the Steps and Procedures for testing. i have QTP 8.2 Can i
Install this Version or do u recommend other Versions ?
Deepa said...
Hi Ankur,
suru said...
hi ankur
m new to testing n m trying 2 learn qtp 9.0... i hv read sm
ppt of QTP but wanna learn hw 2 write scripts....cud u
send me sme material or documents n pls suggest me any
link where i can find any of the samples.
My Email ID is
[email protected]
soni said...
Hi Ankur,
Aman said...
hi,
i know the qtp but i never use it in any live project ..so pls
help me to use the QTP in live projects.If u have any links
regarding live project with QTp pls provide me..this is my
mail id [email protected]
Bamboo said...
Hi Ankur,
I am a tester and i worked in software testing for 2 years.
I always manual test software and never use test tool
before. Now, i want to learn QTP for my job but i don't
know how to start? Could you please show me the way to
learn QTP sufficiently?
stacy said...
http://mercuryquicktestprofessional.blogspot.com/2007/10/vb-script-and-qtp-part1.html 1/4/2011
VB Script and QTP - Part1 | Quick Test Professional(QTP) Page 12 of 15
Hi Ankur
Can u ples send me some easy examples of qtp scripts .so
that i can do some R&D and learn about the process.I
need some scripts in whoch VB scripting is Used.
MY email ID is
[email protected]
Thnaks In advance
richie said...
Hi Ankur
I Want to learn QTP...pls help me
i want to study testing...
Rich
Imran said...
Hi Ankur,
Sun said...
Hi,
Ankuar,
i have 2 years exp in Manual testing right now i interest to
study in Automation like winrunner and QTP. so please
send me the QTP testing books
yogi said...
Hi Ankur ,
I have a question.
dim a(5)
redim preserve a(10)
yogi said...
Hi ankur ,
I have a question.
Is it possible to resize a single dimensional array without
losing the data
Ex:
dim a(3)
Redim preserve a(10)
But
dim a(3,5)
redim preserve a(3,10)
it works.
prit79 said...
http://mercuryquicktestprofessional.blogspot.com/2007/10/vb-script-and-qtp-part1.html 1/4/2011
VB Script and QTP - Part1 | Quick Test Professional(QTP) Page 13 of 15
Hi,
Ankuar,
i have 5 years exp in Manual testing right now i interest to
study in Automation like winrunner and QTP. Could you
please guide me through?
Thanks
Prit
frens said...
Hi all,
can you able to tell how to invoke recovery scenario by
writing vbscript(method)
Thank you
Hi,
i want to know that whats the best way to write an
automation script in QTP. i am a 3+ yrs experence in
manual testing but want to upgrade my skill in
automation. i also done automation course but not clear,
so am totaly scared about to write a script. So please help
me.
richa said...
hello ankur...
venu9955 said...
Deepak said...
Anonymous said...
Hi ankur,
Thanks,
http://mercuryquicktestprofessional.blogspot.com/2007/10/vb-script-and-qtp-part1.html 1/4/2011
VB Script and QTP - Part1 | Quick Test Professional(QTP) Page 14 of 15
Anonymous said...
Hi Ankur,
Ankur i want to know that wats the best way to write an
automation script in QTP. Actually i am a beginner so am
totaly scared about to write a script.Right now i got
clearded 2 technical rounds in niit technology and others
company but niit technology have to 20 days time
prepartion for scripting langauges. So please help me out..
Anonymous said...
pam said...
hi Ankur,
I am beginer in QTP 10.0,
So, i want to write the vbscript in QTP,what is the
procedure to write the script & run the same .plz reply me
on
Thanks
sruthi said...
hi Ankur,
I am beginer in QTP 10.0,
Ranjansoftware.Co.ltd said...
hi rajesh,
I am beginer in QTP 9.5,
Anonymous said...
RAME said...
Anonymous said...
Ankur
http://mercuryquicktestprofessional.blogspot.com/2007/10/vb-script-and-qtp-part1.html 1/4/2011
VB Script and QTP - Part1 | Quick Test Professional(QTP) Page 15 of 15
2) is it a web based
3) what kind of questions will be asked like is it a multiple
choice or theory or practical
4)How much knowledge do you need in qtp to crack this
exam.
sree said...
good info
Bala said...
Hi Ankur,
Ankur i want to know that wats the best way to write an
automation script in QTP. Actually i am a beginner so am
totaly scared about to write a script. So please help me
out..
Post a Comment
http://mercuryquicktestprofessional.blogspot.com/2007/10/vb-script-and-qtp-part1.html 1/4/2011