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.

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I used the below code to open QTP through VBscript?But i can unable to Invoke QTP...PLZ help me with the correct code to invoke QTP through VBS with description of the code aswell. Dim qtApp 'As QuickTest.Application 'Declare the Application object variable Dim qtTest 'As QuickTest.Test 'Declare a Test object variable Dim qtResultsOpt 'Declare a Run Results Options object variable Set qtApp = CreateObject("QuickTest.Application") 'Create the Application object qtApp.Launch 'Start QuickTest qtApp.Visible = False 'Make the QuickTest application visible qtApp.Open "C:\form", True 'Open the test in read-only mode 'set run settings for the test Set qtTest = qtApp.Test qtTest.Run 'Run the test 'WScript.StdOut.Write "Status is: " & qtTest.LastRunResults.Status 'Check the results of the test run qtTest.Close 'Close the test qtApp.quit 'Close QuickTest Pro Set qtResultsOpt = Nothing 'Release the Run Results Options object Set qtTest = Nothing 'Release the Test object Set qtApp = Nothing 'Release the Application object

2665


Hi,All How to create a link in excel sheet using qtp

3235


Can any body please tell me the steps of keyword driven frame work in qtp. My mail is saswat445@gmail.com please send some materials on keyword driven testing in qtp. thanks a lot...

2040


What is meant by Output Value in UFT?

822


tell me exact differenceb bw qtp and selenium?(could not tell open soure and licennce? difference in usage and technical difference?

1888


Explain more about the Test Fusion Report of QTP?

816


what is the difference between rational rose and QTP? WHICH TOOL IS BETTER TO LEARN? PLEASE SEND ME AT sana_50218@yahoo.com sandeep@epuratech.com

2576


What is object repository in qtp?

814


Where we can use the analog mode and where we can use the low – level mode?

808


How can I check if a environment variable exist or not?

781


Which advantages helping QTP to hold the position of "Market Leader" for such a long period?

1623


I want to know can we integrate visual source safe tool with QTP and QC for our version controlling process? WE know QTP and QC 10.0 version is having the version control inbuilt in it but I want to know the merits and demerits of the inbuilt version control tool and the visual source safe tool using QTP and QC.

2711


we use a file extension .properties why is it used and where do we use it plz help me out with detailed explanation and navigation of how to use on the QTP 8.2?

1883


What is the file extension of the code file in qtp?

790


How to Test the mainframe application?

2101