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 use checkpoints in qtp ?

587


How can you pass value one action to another action?

555


How does you test a weblink which is changing dynamically?

554


What are the different types of recovery operation?

555


Can QTP be used for GUI testing ?, We are using Java with MySQL and Operating system is Linux. We are NOT using the web.

1947






Should have experience in framework means?

1418


what is the difference between IE & Netscape in web testing on a log in page

1794


UFT 12.02 which ALM version will support

982


This is a question thats generally asked in every QTP interview. What were the problems that you faced during automation and how did you resolve them?

1468


Define Error Pane of UFT?

692


What is the syntax to call one script from another?

540


what is the difference betn QTP 8.0 AND PREVIOUS VERSION

1954


How to find the difference between 2 dates in qtp?

584


can i change the runtime properties of an object ? How can i check if a parameter exists in database ?

1415


What are the different types of functions available in qtp and explain ?

570