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
Can we access the java methods in qtp. Because my requirement is to access the swt(for eclipse an it is java code) methods in qtp is it possible?
In Test Directory, What are the contents in test case designing? if you prepare in excel sheet how u use thrw Test Directory?
I have enrolled for a QTP course which is a four weekend course.Do you think its a good way to start off learning this tool?What all do i need with me in order to become a pro at using this tool?
How to replay a script in qtp?
How the exception handling can be done using quicktest professional?
How do you handle multiple banners(at the top the page, the banner is scrolling) in a web page(Dont take the name property(regular expression))
What is Cross browser testing? Does UFT support it?
How can we extract data like "Details","Result","Time" from the 'Run Error' result generated in QTP after run time errors are generated during a run & import the details etc...into excel sheet
In qtp, how you can use xpath to identify objects?
What is the use of "New Property" in "Add properties" of testobject properties in object repository. How can i use "New properties" while writing scripts if i have assign some values to the testobject properties Can anyone help me? plz
Approach for Installation,comaptibility,system testing
What is the difference between analog and low level recording?
Explain features of the latest version of qtp/ uft 12.1?
Explain the check points in quicktest professional (qtp)?
Hi Friends, Can anyone help me out in this one? In QTP, I am using Data Driver and want to parameterise multiple values (say 3 values ) for a field. How can I do it using Data Driver wizard? Plz mention it step-by-step. In the end after doing the needful, on opening the Data Driver window, how can I get number (i.e. 3) in the Parameterised column for that particualr value? Thanks a lot in advance.