What is User defined function in QTP

Answer Posted / cheekuri ragini

In QTP after completion of keywords creation for required
objects in SUT, Corresponding test automator can study
testcases to be automated to identify 'repeatable steps' in
those cases.Test automator can automate those repeatable
steps as "User Defined Functions" like shown below.

Syntax: Functionname(arguments)
______________
______________
______________

End Function
In above function arguments are two types. Such as
1. byval
2. byref

ex 1.

function add(byval x, byval y)
x=x+10
y=y+10
End Function
we can store this user difined function in Function Library
folder of CSTAF (frame work)
whenever we required this function in our test script we
can use this user defined function from function library as
like shown below

option explicit
dim a,b
a=10
b=20
add(a,b)
print a
print b

Inthe same way we can pass the arguments by using byref also

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the Test design techniques you uses in ur project?

1576


what QTP Options do you know?

3018


describe some problems that u had with automating testing tool?

1483


what is the difference betn QTP 8.0 AND PREVIOUS VERSION

2057


What is the quicktest professional testing process?

667






How to save your test using quicktest professional (qtp)?

699


Did QTP prove efficient for your project? Yes or No, explain?

6222


How many types of parameters are available in quicktest professional (qtp)?

674


Dear All , For UFT 12.02 which version QC or ALM will support ? Thanks Balaji

1024


Hi, I'm a beginner in QTP and planning of a certification in QTP, but have no idea about it :P. Could anyone please tell me what certifications that a QTP- beginner can take? What is the fees and the syllabus for the certification? Please reply soon. Thanks Vidhya

1516


I recorded a Web App with a Oracle backend using QTP 9.5 and for some reason the scripts don't play back> What am I missing at this point. I recorded the same Apps under Sybase and they work great. This is Oracle 10g. Why won't my scripts play back.

1637


In order to select an automation tool for automating ur application, what r the things u need to consider? For eg i will go for automation; 1) When there is a lot of retesting and regression testing. 2) Return on investments. 3) Whether the tool supports the appln. 4)--------------, etc. Pls give me more number of points because my answer did not satisfy the interviewer. Very urgent pls

1534


1 Folders in VSS 2 In navigation script there are 100 script i want to run first 50 and 37th script also not needed to run how to do this 3 What is navigation script,Driver script, business script what we are loaded in this script 4 use of resource tab 5 Difference between verification and validation give real scenario example 6 file scripting object when to use it 7 what are the problems you are faced while testing web application 8 difference between expert view and keyword view 9 difference between QTP 8.2 and QTP 9.2 navigation frame work please answer these questions from real time working people as early as possible

1688


what is the difference between development and testing

2574


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?

1410