What is the use of "Registeruserfunc" when should we use
it?
Note:Please do not copy paste the date from QTP help.
I tryed it.But I don't Understand where should we use
exactly.

Answer Posted / arun

Its used for "overriding" an existing Method [ex: click).
You can define your own method also.

If you want to try it do the following simple example.

Goto function library and save the below code.

Public Function func
Dialog("Login").WinButton("OK").Click 'for what
operation
End Function
RegisterUserFunc "WinButton", "myfunc", "func"

Now you have registered this function with the object
winbutton.

now associate this function lib to a new test
so the test should have code like this....

SystemUtil.Run "C:\Program Files\HP\QuickTest
Professional\samples\flight\app\flight4a.exe","","C:\Program
Files\HP\QuickTest Professional\samples\flight\app\","open"
Dialog("Login").WinEdit("Agent Name:").Set "arun"
Dialog("Login").WinEdit
("Password:").SetSecure "4c9adb5be66f637242d3941587f3a0762c6
e5350"

Dialog("Login").WinButton("OK").myfunc
Window("Flight Reservation").Close

now run the test u see the difference and the use of
register user func

Note: To run this test, you should have all the objects
saved in your object repository


Regards
praveen and arun

Is This Answer Correct ?    13 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to upload excel files into Quality Center using QTP Script and how to delete excel files from Quality?

856


what type of framework u r using in ur organization

1861


How many types of object repository in qtp?

871


Can we run test with out adding object in object repository? How it is possible?

843


any body can you help me what is the script to automate an comand promt

2245


Why is action split used by qtp?

773


am not having intrest in coding lang like c c++ java etc can i choose Testing tools as my carrier and please suggest me which tool is good (suitable for me)

1528


how could i download qtp in which i get add-in support for 'oracle' is there any way to get it? i finding but not getting pls help me out :)

1648


Hi How to retrieve data from web element line by line?

1815


i want information about API testing and i want info like how process can be done in company? i want added info like coding ,debugging, desing in c.v ? what should add in c.v for eg banking domin? pls any answer my question?

1820


Explain xml checkpoints.

875


What are the things(properties, and other details) will be recorded while recording an object using normal recording?

1751


Which functionalities of QTP used in banking project?

2207


There is an built in window application in qtp9.1,i.e.Flight4.0.i want to implement the recovery maneger on it.How can i do this?

1845


How to test results for qtp ?

988