how to create user defined functions in QTP? can any one
expalin me with example..
Thanks in Advance for help
Answer Posted / prashanth chenna
Creating User defined Functions:
Open QTP and Application --> type function header along
with Unique function name and arguments --> Record
repatable operations in application as function body -->
follow above navigation to create more then one functions --
> Save that functions in a file using 3rd party s/w with
Extension .vbs( Copy the script, genarated in QTP and paste
in Notepad, MS.Word etc.) --> now goto Resource menu in
QTP --> object Repository --> file menu --> Export Local
Objects --> Enter file name with Extension .tsr --> click
Save.
Calling User defined Functions:
In QTP --> type Useer defined function name along with
argument values --> file menu --> settings --> Resources
tab --> click + icon -->browse the path of the file -->
click apply --> click OK --> Resources menu in QTP -->
Associate Repositories --> Click + icon --> browse the path
of references file --> select current action --> click OK.
Example:( Creating User defined Function )
Public function login(x,y)
Dialog ("Login").winedit("User name").set x
Dialog ("Login").winedit("Password").setsecure
crypt.encrypt (y)
dialog ("Login").winbutton("OK").Click
End Function
( Calling User defined Function in a test )
login "prashanth","testing"
Is This Answer Correct ? | 15 Yes | 2 No |
Post New Answer View All Answers
When I click on a link in web page.Link should open in new window.can anyone please let me know the script for this ---Koti
What is the use of ordinal identifier in qtp?
what are the challenges you have faced while testing web based application using the automation tools ?
Discuss quicktest professional (qtp) environment?
Hi any body pls help me for QTP 11.0 software free demo version. i have to practice. Kindly send the link.or where i have to download.
What is the extension of the qtp local repository? If it is .mtr then what is .bdb extension stands for?
Can the user toggle between using Local OR and shared OR for the same action?
what is the difference between development and testing
Where to use function or action?
Which advantages helping QTP to hold the position of "Market Leader" for such a long period?
What is quick test pro?
How to explain a banking project in interview as a test engineer???
Will there be any standards or requirements for page appearance and/or graphics throughout a site or parts of a site?
How to upload excel files into Quality Center using QTP Script and how to delete excel files from Quality?
How to use setroproperty?