Hi PLZ explain User Defined Functions in QTP with eample?
Answers were Sorted based on User's Feedback
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 |
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 |
what is the hierarchy to use properties in descriptive programming
How to execute a WinRunner Script in QTP?
If you have given 1000 manual test scripts, what test you will do? and how?
how to generate numbers in between to numbers suppose numbers in between 500 to 1000 in sequencies using vbscript
What is the syntax to call one script from another? And what can be the syntax to call one “action” in another?
What is a Patch in QTP?
unique properties of button,edit box, radio button,check box?
How to call Datable values in the QTP program. exp: I have two parameters like Email id and Password this two i would like to add multiple entries in the datable to use it. What is the difference between Gobal/Action datatable
Whats the realtime QTP testing process
How to get popup error message.
when qtp recognizes a web link like (hyper link)wich properties it is going to take to identify the objects unquely? what is Ini file in QTP?
How to add a page checkpoint to your test?