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

WHAT IS THE DESCRIPTIVE programming when it is useful? & when to use this ?

2 Answers  


What is the best institute in Ameerpet? If people think Ameerpet is the pride of hyd they need to go to Delhi/Gurgaon/noida you can find the difference.

3 Answers  


What are main panes available in qtp test browser?

0 Answers  


How many types of Parameters are available in QTP? and Pls Explain with example.

4 Answers   LG Soft,


tell me about if in the interview what i should tell about pharma application,what r the pharma application concepts,i need pharma application testing features

0 Answers  






Tel me what was the automation testing process you followed?

2 Answers  


suppose u hav a 10 dialog or window opened on screen with same name & value. now how to test each window? i.e. how qtp indetifies these objects separately?

7 Answers   Wipro,


what testplan contents and what test strategy contents,what is the diff b/w them

0 Answers  


Give the syntax to import/export xls into qtp.

0 Answers  


What are the details steps to connect a remote mysql database in QTP

1 Answers   Verizon,


What all challenges you have faced during automation and how you have resolved it?

2 Answers   Genpact,


When I parameterize a script then for each iteration script is executed from begining to end. If I want to execute some middle steps multiple times using Parameterization (avoiding begining and end steps), what is the solution of this (e.g. total steps are 1 2 3 4 5 and i want 2 3 4 only(not 1 nd 5)

2 Answers  


Categories