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

does qtp need record and playback in realtime. plz tell exactly wat happens

3 Answers   HP,


please write a script to find the text in a application. Note: i dont know the location of that text where it is located. just like negative testing.

2 Answers   BSL,


What is iteration?

1 Answers  


Which scripting language used by quicktest professional?

0 Answers  


In QTP, If you have list of checkboxes, how can i select a particular checkbox and delete if the checkboxes are changing dynamically?

0 Answers  






Hoe we can export TEST RESUALT IN to XL-sheet?

1 Answers   IBM,


How to handle the exceptions using recovery scenario manager in QTP?

1 Answers   Crea,


what r the main benefits of automation?

2 Answers  


In Remote acess server how u run a test?

0 Answers  


Write a user defined function to count the no. of buttons existed in a webpage ? i dont want to use descriptive.create ()

1 Answers  


what is the frame work your using in automation testing

2 Answers  


My project title is "DRUG Audition and research management" it comes which domain?

4 Answers  


Categories