How to create Userdefined Function.Please write the steps
ans also provide example where exatcly we use it.

Answer Posted / chandu

Hi,
u can create user defined functions in notepad by saving
the file with .vbs extention.
eg:
public function add
x= 20
y= 30
z= x+y
msgbox z
end function
paste the above code in notepad and save it as .vbs ext.
then go to QTP file>settings>resources tab
add the .vbs file there. and then write-- call add---in ur
QTp editor.the use of this is u can reuse the same function
wherever u want. so u can call it multiple times in ur
test.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between Recording time object identification and Run time (Execution) time.

1249


How to carry out bit map check points in QTP

1952


Hi Friends... By using QTP , can we test .net products...and that product supports different languages.. thanx in advance..

4481


before launching qtp, we need to close all the open browsers u dont know what are all the browsers either it might be ie,mozilla etc and u dont know how many brosers are open.... u need to close all these before launching qtp.. can anyone plz temme d solution...

7654


There are 10 rows in the datatable. How can we fetch 2 rows and then skip 3rd row. After that, pick 4th & 5th row and skip 6th row. Please share code

1446


Is there anyway to automatically update the Datasource name in Database Checkpoints object when we migrate tests to a new release?

3532


Hi can anybody send me the QTP material, To my email ID: nuve1284@gmail.com ?

1899


HI, pls help me on this, iam not able to capture getcelldata value in javatable... msgbox javawindow("").javatable("").getcelldata(3,3) but it diaplays empty...

2618


unique properties of button,edit box, radio button,check box?

4117


If you are testing a web application then what will you test in that application?

1780


What are the features supported by UFT?

853


How many types of trigger events are there in qtp?

751


Can anyone pls tell me how to do action parameterization (input and output parameters) with respect to login window and insert order of flight reservation window in detail( pls give a clear step by step explanation with example) anyone please. Will be very thankful to u

1549


How to associate function library at a run time?

899


i have doubt suppose iam purly working in QTP, when i will work on sql and performence testing? pls any one clarify doubt?

1728