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
How will you report the bug and explain the defect tracking sheet you handled?
How many types of parameters are there?
can anyone tell me from where i can download qtp demo or crack version
when a test case is written how u test using qtp
what is the advantages and disadvantages of using functions instead of re usable actions
Which features or drawbacks of QTP lead to the upgrade for a newer version?
What is the significance of “action 0” in qtp?
If I change the property value at runtime is it effect is object repository?
PLEASE TELL ME WHEN DO YOU USE THE OBJECT SPY AT RUN TIME
How is recording done when a application is over lapping the QTP application it gives a message object not recorded
How will you compare keyword and expert view?
What kind of performance is expected on the client side (e.g., how fast should pages appear, how fast should animations, applets, etc. load and run)?
Please Don't mind .i want in detail the real time process i.e in each document what it contains.
What is the difference between a Function and Procedure in QTP?
How often were they executed?