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...


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.

Answers were Sorted based on User's Feedback



What is the use of "Registeruserfunc" when should we use it? Note:Please do not copy p..

Answer / 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

What is the use of "Registeruserfunc" when should we use it? Note:Please do not copy p..

Answer / anish pillai

RegisterUserFunc in QTP can be used for both Method
Overriding as well as Method Reuse.

In method overriding, we can override the default
implementation of the function and replace with a new custom
implementation. For example, we can create a function, say
fnClick, which will not only click on an element, but it
also first verify if the element we want to click exists and
is enabled.

In method reuse, we can create a function which we can bind
with multiple controls & then use this function for all
these controls. For example, we can create a function
fnClick, which can be used to click on a button, on a link
on an image and so on. Refer below link for more details -

http://www.automationrepository.com/2011/12/how-to-achieve-method-overriding-and-reuse-using-registeruserfunc-in-qtp/

Is This Answer Correct ?    8 Yes 1 No

What is the use of "Registeruserfunc" when should we use it? Note:Please do not copy p..

Answer / rentalavdml

Its used for "overriding" an existing function

Is This Answer Correct ?    7 Yes 4 No

What is the use of "Registeruserfunc" when should we use it? Note:Please do not copy p..

Answer / rajeev

We are using this method to register an user defined function to QTP so that tool will display the registered user defined function in the drop down list directly like when we are using the inbuilt functions.
For example if we are preparing the script by using cint,cdbl,time,date functions etc... these functions are visible in drop down list .


RegisterUserFunc:- We are using this method to register the user defined function for particular class in QTP.
Syntax:- RegisterUserFunc,"ClassName","Function Name","Method Name",True
Example:-
Public function ButtonEnabled(Obj)
var= Obj.GetRoProperty("Enabled")
If var="True" Then
msgbox "Pass"
else
Msgbox"fail"
End If
End Function

Navigation:- Prepare the user defined function > like above in QTP > Copy the function and paste it in notepad > save as .vbs file > associate the .vbs file to the QTP > Prepare the test script like below
Dialog("Login").WinEdit("Agent Name:").Set "rajeev"
Dialog("Login").WinEdit("Password:").Set "mercury"
Dialog("Login").WinButton("OK").ButtonEnabled("cancle")
Dialog("Login").WinButton("OK").ButtonEnabled("OK")

Is This Answer Correct ?    3 Yes 3 No

What is the use of "Registeruserfunc" when should we use it? Note:Please do not copy p..

Answer / rayudu

Can you please explain with examples

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More QTP Interview Questions

How to remove associated function library?

0 Answers  


How to test background color and dynamic images which are moving during runtime?

7 Answers   CTS,


In how many ways we can add check points to an application using QTP.

2 Answers   Infogain,


How can i click on any Excel sheet's "H" column with out writing coordinates Ex:Window("Book1").WinObject("Book1").Click 498,14 I dont want to give coordinates like 498,14 Can i open "H" column by writing like Ex:Window("Book1").WinObject("Book1").Click "H" or Ex:Window("Book1").WinObject("Book1").Click "H","1" or Ex:Window("Book1").WinObject("Book1").Click H,1 If i want to click on "Sheet3" of an excel sheet, Can i open like Ex:Window("Book1").WinObject("Book1").Click "Sheet3" Please help me any one

0 Answers   Livetek,


How is UFT 11.5 version different from UFT 12.0?

0 Answers  


Explain the types of object repository?

0 Answers  


what is descriptive.create()in qtp?

3 Answers  


hi can anybody help with an qtp 9.2 license key please. Thanks, Nitesh.

0 Answers  


how to insert QTP to display errors and other description in the test results instead of halting execution by throwing error in the mid of executin due to an error (for object not found)?

1 Answers   Ordain Solutions,


What the genaric function to connect Sql Server using Sql Server Authentication and Windows Authentication

1 Answers  


How do you check ticket cost and ticket number in flight application?

0 Answers  


I am sathish , i want to test the Application of JIL.org ,Mobile Emulator ,by using QTP10.0. I am trying to do testing on that Application , but Child Objects are not identified by the QTP. Please can any one help me

0 Answers  


Categories