Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How will you report the bug and explain the defect tracking sheet you handled?

3091


How many types of parameters are there?

993


can anyone tell me from where i can download qtp demo or crack version

2005


when a test case is written how u test using qtp

2125


what is the advantages and disadvantages of using functions instead of re usable actions

1961


Which features or drawbacks of QTP lead to the upgrade for a newer version?

1038


What is the significance of “action 0” in qtp?

1060


If I change the property value at runtime is it effect is object repository?

1095


PLEASE TELL ME WHEN DO YOU USE THE OBJECT SPY AT RUN TIME

7533


How is recording done when a application is over lapping the QTP application it gives a message object not recorded

2070


How will you compare keyword and expert view?

935


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)?

1060


Please Don't mind .i want in detail the real time process i.e in each document what it contains.

1894


What is the difference between a Function and Procedure in QTP?

1196


How often were they executed?

2458