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



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

Answer / 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

More QTP Interview Questions

While recording a login window QTP is identifying only parent window,then how can u identify the child objects.

2 Answers   Symphony,


what are the principles of good testing scripts for automation?

1 Answers  


Can you give me the code to calculate the total number of Links using the child object in the web page..? is there any other way to calculate number of links with out using the Child objects.??

2 Answers   DST Global Solutions,


how will check the links in multiple pages at a time

3 Answers  


Hi, Hope you viewers are doing fine with good health. What are the steps and connection parameters to connect to Oracle db ? Can you connect with just the Oracle client or Oracle XE ? Cheers!!

0 Answers   Infosys,






Hello, How can i capture first letter of any string using QTP. For ex.. i want "j" in the below string "john" could any one explain me? Is there any function for that?

4 Answers   Livetek,


How to open any application during Scripting in QTP?

7 Answers   Celgene, IBM,


can any one tell me the script to click on a button in the wintoolbar.

1 Answers  


How you can make an action as re-usable action?

0 Answers  


Write a user defined function to count the no. of buttons existed in a webpage ? i dont want to use descriptive.create ()

1 Answers  


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

0 Answers   Tech Mahindra,


How to execute a VBS file without using Execute File statement?

3 Answers   iGate,


Categories