Hi PLZ explain User Defined Functions in QTP with eample?

Answers were Sorted based on User's Feedback



Hi PLZ explain User Defined Functions in QTP with eample?..

Answer / amarendra kothuru

Functions - two types
1)Buitin - Prepared by QTP
2)User Defined - Prepared by programmer/tester

Syntan to creat User defined function in QTP

Function FunctionName(Parameter1, Param2,.....)
Statement1
Statement2
.....
.....
End Function

Example:

Function Bigger(value1, value2)
If value1 > value2 Then
Bigger = value1
Else
Bigger = value2
End If
End Function

Calling the function in the script

Result = Bigger(20,21)
Msgbox Result 'gives 21

Is This Answer Correct ?    2 Yes 0 No

Hi PLZ explain User Defined Functions in QTP with eample?..

Answer / narendra

User defined function is a peice of code/program which
intended to perform some specific task.
e.g if i want to create 100 user id's and i can use each id
to create a profile. To avaoid duplication of ID's we can
write a function (.vbs extension) which generate ID's based
on system date and time so all the ID's will unique. After
that we need to add that function into resources tab in QTP
and can call that function using a single line statement
as ...call <functionname>(arguments, if any)

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More QTP Interview Questions

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

0 Answers  


What are the types of environment variables in qtp?

0 Answers  


what is the difference between Automation object model(AOM) and test object model(TOM)

2 Answers   UHG,


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

0 Answers  


How to make qtp understand the difference amongst the same type of objects .suppose there are 5 check boxes in a page and I have to choose the 2nd one, how to do that through script?

0 Answers  


How to send the qtp results file by email (Lotus notes).

1 Answers   TCS,


What is the difference between low level recording and virtual object.

2 Answers   Tech Mahindra,


Hi,All How to create a link in excel sheet using qtp

0 Answers  


How should I click on the right click menu objects When I trying to add the object properties to the OR.It is showing only Window(Window).Not all the objects of the window. Also while recording I found No script. How to solve this>.

0 Answers  


Hi, OUR PROJECT NAME IS: HOSPITAL CONTROL SYSTEM. IS IT COMES UNDER WHICH DOMAIN(HEALTH CARE OR HEALTH INSURANCE)

4 Answers   Four soft,


How to retrive XML file data in QTP ? using Script(Chandana)

6 Answers   Wipro,


How can I find out the cursor position through QTP suppose I am keep tabbing(Pressing the tab key continuously) and stoped at a position Now I want to find out where the cursor position is

0 Answers   HP, Livetek,


Categories