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

Hi we are running tests remotely from quality center and pushing tests into qtp boxes remotely, and it does execution but while uploading results back into quality center it hangs in qtp box.If any one come across similar problem, please send me details how to handle this. Thanks kris

0 Answers  


Hi, Can anyone write the following qtp script...please its urgent ·Navigate to Google in a new IE instance ·Search for the following word "Gap, Inc." ·Iterate thought the first 10 pages of google ·On each page collect the following ·The "blue" page title ·The "green" url ·Output all the data into a file named "test_output.txt" ·Format "Title – URL"

1 Answers  


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

0 Answers  


can we change the name of a check point? when will you start writing testcases? do you follow any methodology for writing test scripts? qtp is key word driven testing or data driven testing?

2 Answers  


Without QTP (or any Testing tool) can we able to test the GUI part of the Applications. for Example generating the Scripts in Notepad and Executing them Using VB. Is it Possible to do so..

2 Answers  






what is spy, and how can u use?

1 Answers  


what is web application and client server application.is there any difference ?

1 Answers   Wells Fargo,


Which is the best QTP training institute in Delhi/NCR region and what is the approximate fee for QTP course (Basics and Advanced)

0 Answers  


How can we automate Capthca on registration or any contest forms ? Is it possile to Automate Webpages with Falsh using QTP..?

1 Answers  


what is meant by source control?

0 Answers   Ordain Solutions,


How can we redirect QTP results in to a excel sheet after the execution

3 Answers   SAP Labs, Virtusa,


If u r using library files (Instead of Check Points) , How do u do bitmap check ?

0 Answers  


Categories