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 |
anyone can explian about types of "Triggere Events" in QTP
What is the Risk Analysis? Waht types of risk analysis are there?
how to load the *.vbs (or) test generating script in a new machine?
Can we do qtp testing without creating objects in Dbject repository? can we do it completely writing code i.e in expert view only. Are there any books for this?
how to select particular value from the combobox in the current page which is entred in the previous page editbox after parameterization?
can u write Script to do Data Driven Testing throuh Externel & internel XL Sheet
how do we know whether all objects are stored in the object repository or not? how can we know if a particular object is not stored in the repository?
difference Between Call Run action and copy of action?
What is the difference between Keyword Driven test and Data Driven test?
When Recovery scenario actually starts while testing the application?
What are the most frequent errors you faced while executing your scripts?
how to click on object? (with out knowing the object details) for ex: in a webpage one link is available.i want to click that link by using one menthod through qtp?