How to call the userdefined functions to script? If i am
stored 'add()' function in Library functions folder. i want
to cal that function in my script.

Answers were Sorted based on User's Feedback



How to call the userdefined functions to script? If i am stored 'add()' function in Libr..

Answer / murali raju

Instead of add name put the add1 as ur function
name...because add is keyword

Function add1(a,b)
c=a+b
add1=c
End Function 'put the function .vbs file and save it c
drive with the file name addition.vbs

write the below script in ur qtp

ExecuteFile "c:\addition.vbs"
x=add1(2,4)
msgbox x 'it will be prints 6 in the msgbox

Is This Answer Correct ?    1 Yes 0 No

How to call the userdefined functions to script? If i am stored 'add()' function in Libr..

Answer / pramod

But your code is giving me acess denied error

how to save the function as .vbs thorugh QTP or VB

Is This Answer Correct ?    0 Yes 0 No

How to call the userdefined functions to script? If i am stored 'add()' function in Libr..

Answer / murali raju

Hello...pramod..Put the function in notepad and save
as .vbs extension then call through the above execute file
statament in qtp ...ok.na..

Is This Answer Correct ?    0 Yes 0 No

How to call the userdefined functions to script? If i am stored 'add()' function in Libr..

Answer / umesh

Save your functions in a notepad and save it as a .vbs file.

Under Test Settings - Resources tab, Associate your .vbs
file as a Library.

Call the .vbs file as a header in your script and use all
the functions.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

what is the use of Browser.sync()

2 Answers   NIIT,


How can we make a shared object repository in QTP 9?

3 Answers   Kanbay, Ordain Solutions,


How to test whether the navigation i.e. from one page to another is working r not using QTP for web based application

1 Answers  


Can u Reduce the size of Object repository? What are the problems u have faced in Qtp tool?

2 Answers   IncRev,


In an output value text checkpoint, where does the output value stored by default ?

4 Answers   Ordain Solutions,


hi everybody this questions is only for qtp real time users. anyone please clearly explain the approach u r following for qtp testing in ur company or qtp framework u r following in ur company pelase give me clear explanation then u did great favour to inexeprienced qtp users

0 Answers   Automobile, EDP,


How to get the column count and column name from the resultset in the database connection program?

6 Answers  


How to create log file in qtp?

2 Answers   AppLabs,


explain keyword driven framework?

2 Answers   Mindlance,


what is object repository?

4 Answers  


can we run the scripts of qtp 8.2 in the qtp7.0?

2 Answers  


How exactly you start scripting in QTP? In the interview he was not satisfied with my answer.Please post what is correct answer.

5 Answers  


Categories